Skip to content

Blazor Server does not work after upgrade to .NET 8.0 #52095

Closed
@Suchiman

Description

@Suchiman

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have an ASP.NET Core 7 app that mostly uses traditional MVC with razor views that utilizes blazor server on some subpaths.
After upgrading to .NET 8.0, by upgrading the TargetFramework and PackageReferences, not doing any code changes, the blazor pages stopped working correctly.

They pre-render correctly but are not interactive. I include them by having <component type="typeof(App)" render-mode="ServerPrerendered" /> in a cshtml file at the subpath where blazor starts being used, e.g. https://app.tld/Admin hits an MVC controller that returns a View that includes said markup. If i change it from ServerPrerendered to Server, all i get is a white page.

I can see that a websocket connection for blazor is established but there's no error message in the browser console nor on the ASP.NET Core console window.
All the Browser console says is

[2023-11-15T18:41:50.278Z] Information: Normalizing '/_blazor' to 'https://localhost:44311/_blazor'. blazor.server.js:1
[2023-11-15T18:41:50.327Z] Information: WebSocket connected to wss://localhost:44311/_blazor.

If necessary, i can try to create a minimal project but if anyone knows off the top of their head what i'm doing wrong, that would be great.

Expected Behavior

Blazor Server should just continue to work in .NET 8 as it did in .NET 7 per the upgrade guide https://learn.microsoft.com/en-us/aspnet/core/migration/70-80?view=aspnetcore-7.0&tabs=visual-studio#update-a-blazor-server-app

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

8.0.100

Anything else?

No response

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