Skip to content

New Blazor Web Application, navigate to the server project's component auto display "Not Found". #58480

Closed
@DillionVVV

Description

@DillionVVV

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I create a Blazor web application via the Blazor Web App Template, then in the Blazor Server project add a Test component (set the rendermode as InteractiveServer), after running the application and navigate to the Test page, firstly it will show the Test page content, after some seconds (2 or 3 seconds), it will auto display "Not Fount" in the page.

Expected Behavior

After redirecting to test page, it should stay on the test page instead of showing "Not Found".

Steps To Reproduce

  1. Create a new Blazor application using the Blazor Web App Template.
    In the Additional Information window, select the "Auto (Server and WebAssembly)" Interactive render mode and "Global" Interactivity location:
    Image

  2. In the Server project, add a Testpage component in the Components/Pages folder, like this:

    Image

  3. Running the application, navigate to the Test page, firstly the output as below:

    Image

    then, a few seconds later, it will auto display "Not Found", like this:

    Image

Exceptions (if any)

No exceptions.

.NET Version

.net version: 8.0.403 and 9.0.100-rc.2.24474.11

Anything else?

I check it using the following version of VS 2022, both of them show the same issue:

Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.11.5

Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.12.0 Preview 3.0

Besides, I also compare it with my old Blazor Web Application, it seems that this issue relate the Routes.razor component and the Layout content, in previous projects, these files are in the Server project, but now they are in the Client project.

Image

If I add the Test component in the client project, or move the Routes.razor and Layout content from client project to the server project, it doesn't show the "Not Found" issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions