.NET 6.0 Blazor Server app: WebSocket connection to 'ws://localhost:60908/BlazorApp1/' failed

Viewed 4586

When I create a new, clean Blazor .NET 6.0 app and start it (using Visual Studio 2022), I see the following error in the browser console:

WebSocket connection to 'ws://localhost:60908/BlazorApp3/' failed: (aspnetcore-browser-refresh.js:234)

Error in browser console

Does anyone else have this and any idea if this is a VS2022 bug and how to fix it?

2 Answers

I had exactly the same issue after installing Visual Studio 2022. I tried to "Enable WebSocket Protocol" but that didn't work. However, the fix for me was to change Script Debugging to "Enabled".

Hopefully, this can help you too.

Related