Open
Description
I have a Blazor WASM client project and a Blazor Server project for APIs/login pages. I'm attempting to add deep linking and page reload support. I added the following line to my Server project Program.cs
app.MapFallbackToPage("/");
I have a page in my Wasm client project with the Page route
@page "/"
But when I launch the project with this, any page will fail with the following exception.
System.InvalidOperationException: Cannot find the fallback endpoint specified by route values: { page: /, area: }.
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.DynamicPageEndpointMatcherPolicy.ApplyAsync(HttpContext httpContext, CandidateSet candidates)
at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.SelectEndpointWithPoliciesAsync(HttpContext httpContext, IEndpointSelectorPolicy[] policies, CandidateSet candidateSet)
at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>g__AwaitMatch|10_1(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
Without this line, everything will load fine, the site will work but if you refresh any page that isn't the homepage, it will fail for a variety of reasons.