Blazor Server - Cannot find the fallback endpoint specified by route values: { page: /_Host, area: } exception with RC1

See original GitHub issue

Describe the bug

I have a Blazor Server app (here) which has been running fine with all of the .Net 6 previews. It’s currently deployed on Preview-7 and working without issue.

Last night I upgraded to .Net 6 RC1, and am now see this exception at startup:

InvalidOperationException: Cannot find the fallback endpoint specified by route values: { page: /_Host, area: }.
Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.DynamicPageEndpointMatcherPolicy.ApplyAsync(HttpContexthttpContext,CandidateSetcandidates)

I have made no code changes.

Reverting to Preview-7 by removing the RC1 SDK (per the instructions here) resolved the problem and the app starts as expected.

Is there a breaking change between Preview7 and RC1 I’ve missed that means I need to make code-changes. I had a look at the breaking changes list but couldn’t spot anything that didn’t happen in earlier previews.

Exceptions (if any)

InvalidOperationException: Cannot find the fallback endpoint specified by route values: { page: /_Host, area: },
Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.DynamicPageEndpointMatcherPolicy.ApplyAsync(HttpContexthttpContext,CandidateSetcandidates)
Microsoft.AspNetCore.Routing.Matching.DfaMatcher.SelectEndpointWithPoliciesAsync(HttpContexthttpContext,IEndpointSelectorPolicy[]policies,CandidateSetcandidateSet)
Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>g_AwaitMatch|8_1(EndpointRoutingMiddlewaremiddleware,HttpContexthttpContext,TaskmatchTask)
Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContextcontext)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContextcontext)

Further technical details

  • ASP.NET Core version: 6.0.100-rc.1.21458.32
  • IDE: VS for Mac 2022 Preview
  • OS: MacOS Monterey 12.0 Beta (21A5506j)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
pranavkmcommented, Sep 15, 2021

There’s some performance improvements in using the source generator, but the biggest benefit is in being able to hot reload .razor and .cshtml files. It does not help with VS4Mac right now as we haven’t done the work to enable hot reload, but having it off would prevent hot reload for .razor / .cshtml from working in VS and dotnet-watch.

2reactions
javiercncommented, Sep 15, 2021

@Webreaper thanks for contacting us.

We’ve identified that the underlying issue for this is a bug in the razor source generator that prevents the views from being compiled into the assembly

You can try use

<PropertyGroup>
  <UseRazorSourceGenerator>false</UseRazorSourceGenerator>
</PropertyGroup>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find the fallback endpoint specified by route values: ...
Cannot find the fallback endpoint specified by route values: { page: /_Host, area: }. Error when I start the project, In the startup...
Read more >
New Application Created but Not Running / Functioning
I found this thread: Blazor server template throws exception on "Cannot find the fallback endpoint specified by route values: { page: /_Host ......
Read more >
Cannot find the fallback endpoint specified by route values ...
Debugging/Running of Blazor Server not possible due to "InvalidOperationException: Cannot find the fallback endpoint specified by route values: ...
Read more >
Alternate _Host file in sub-folder gives "cannot find the ...
I have a blazor server (7.0) app, where I have a sub-folder I want to do ... find the fallback endpoint specified by...
Read more >
Changing Blazor folder gives me "Cannot find the fallback ...
Blazor Server "Cannot find the fallback endpoint specified by route values: { page: /_Host, area: }." Blazor Cannot find declaration of exported type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found