When firing up a new Blazor Server App with .NET 8 Preview, the following error was occurring.
An unhandled exception occurred while processing the request.
InvalidOperationException: Cannot find the fallback endpoint specified by route values: { page: /_Host, area: }.
Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.DynamicPageEndpointMatcherPolicy.ApplyAsync(HttpContext httpContext, CandidateSet candidates)
To resolve, the project file can be updated with
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PropertyGroup> | |
<UseRazorSourceGenerator>false</UseRazorSourceGenerator> | |
</PropertyGroup> |
References
More info available on UseRazorSourceGenerator at https://learn.microsoft.com/en-us/aspnet/core/razor-pages/sdk?view=aspnetcore-7.0