Skip to content

donet 8 Blazor Interactive Server does not route to Razor Pages (MVC) #53979

@mwiaduck-ecc

Description

@mwiaduck-ecc

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

In .NET7 I have a project that mixes Blazor Server with Razor pages to perform login (Login.cshtml.cs) and logout (Logout.cshtml.cs). After going through the documented upgrade path today, and installing .net 8.0.101 everything in the webapp seems to work fine except the login/logout features.

The app simple has tags with an href="" attribute to perform the navigation to either href="/api/flow.js?q=https%3A%2F%2Fgithub.com%2Fdotnet%2Faspnetcore%2Fissues%2Flogin" or href="/api/flow.js?q=https%3A%2F%2Fgithub.com%2Fdotnet%2Faspnetcore%2Fissues%2Flogout"

In .NET8 I now get a 404 error. I even tried using the NavigationManager class to route there and received an exception that the route was not found. Note that my app requires that I use rendermode="InteractiveServer" for the component.

Expected Behavior

Newly added Razor pages within a Blazor project should route properly.

Steps To Reproduce

  1. Create a new blazor web app
  2. In the Components\Pages folder create a Razor page dotnet new page Test
  3. Build and run dotnet run
  4. Route to /test and see the 404

Exceptions (if any)

No response

.NET Version

8.0.2

Anything else?

I use Rider for coding currently and it is up-to-date. I tested how it ran in .NET 7 and was fine; after installing 8.0.101 (even 8.0.2), upgrading the project using the documented path the login/logout features broke entirely. Everything else works great, though!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions