Skip to content

Blazor Web App Template Global Interactivity location causes Not Found issue when navigate to the page/component in Server project. #58944

Closed
@DillionVVV

Description

@DillionVVV

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Firstly, I understand the basics of Blazor render mode. When we use "Blazor Web App" template create application, it will generate two projects: main project (server) and .Client project (client), then we need to put the server-side rendering component in the server project and put the client-side rendering component in the .client project.

Recently, I found that when use "Blazor Web App" template create application, in the Additional Information window,

Image

If we select the select the "Auto (Server and WebAssembly)" Interactive render mode and "Global" Interactivity location, 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 Found" in the page.

I have also report this issue in this thread: #58480

But this issue still not fixed in .NET 9.

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 response

.NET Version

.NET 8 and .NET 9

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) - Current Version 17.12.0

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

Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.13.0 Preview 1.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

And when use "Blazor Web App" template create application, in the Additional Information window, if we select the "Per page/Component" Interactivity location, these files are also in the server project.

So this might be a bug about the "Blazor Web App" template and Interactivity location. Please help to check and fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Status: No Recent Activityarea-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions