Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 321
Mcanic Avatar asked Nov 18 '25 08:11

Mcanic


1 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.

like image 95
Vitali Karmanov Avatar answered Nov 20 '25 04:11

Vitali Karmanov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!