Closed
Description
On kestrel (and probably on IIS too - check #8368) is not possible to set application path. Using preview3.
Startup
snippet:
public void Configure(IApplicationBuilder app)
{
app.UsePathBase("/foo/");
app.UseStaticFiles();
app.UseRouting(routes =>
{
routes.MapRazorPages();
routes.MapComponentHub<App>("app");
});
}
correctly handles Razor Pages, but inside components there is an error:
Microsoft.AspNetCore.Components.Browser.Rendering.RemoteRenderer - Unhandled exception rendering component: 'Router' cannot find any component with a route for '/foo/bar', and no fallback is defined.
System.InvalidOperationException: 'Router' cannot find any component with a route for '/foo/bar', and no fallback is defined.
at Microsoft.AspNetCore.Components.Routing.Router.Refresh()
at Microsoft.AspNetCore.Components.Routing.Router.SetParametersAsync(ParameterCollection parameters)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterCollection parameters)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.Rendering.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.Rendering.Renderer.ProcessRenderQueue()
at Microsoft.AspNetCore.Components.Rendering.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderHandle.Render(RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
at Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()