'Blazor Server "Cannot find the fallback endpoint specified by route values: { page: /_Host, area: }."
I started experiencing this issue with Visual Studio 2019 after upgrading from dotnet 6.0-Preview6 to 6.0-Preview7. There appears to be a race condition when running my app.
I've created a new Blazor Server app in Visual Studio. When I start debugging, my browser launches, but then I get an InvalidOperationException. I've made no changes to the project out of the box.
Cannot find the fallback endpoint specified by route values: { page: /_Host, area: }.
Full Stack Trace
Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.DynamicPageEndpointMatcherPolicy.ApplyAsync(HttpContext httpContext, CandidateSet candidates)
Microsoft.AspNetCore.Routing.Matching.DfaMatcher.SelectEndpointWithPoliciesAsync(HttpContext httpContext, IEndpointSelectorPolicy[] policies, CandidateSet candidateSet)
Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>g__AwaitMatch|8_1(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
This happens about 4/5 times I try to debug. Every once in a while, it works correctly. This issue is not related to my current project, as I am seeing the same behavior in other Blazor Server apps.
If I use Visual Studio 2022 Preview, my app runs properly every time.
I also have 100% success rate when starting my app with dotnet watch run.
I've tried repairing my dotnet 6.0-Preview7 installation, but I can't seem to get around this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
