When trying to debug a Blazor client side app I keep getting the error
Debugging connection was closed. Reason: WebSocket disconnected
I open Chrome with "%programfiles(x86)%\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 https://localhost:50868/
and do not have any extensions installed in Chrome.
I followed the instructions https://learn.microsoft.com/en-us/aspnet/core/blazor/debug?view=aspnetcore-3.0 but no luck.
Have you guys ever faced this situation? Any idea on where I should be looking at?
Blazor projects are slow on the client-side because you have to download the entire dot net runtime along with the necessary DLL libraries on your browser. Additionally, Blazor apps have latency issues.
Blazor is a web framework for building web UI components (Razor components) that can be hosted in different ways. Razor components can run server-side in ASP.NET Core (Blazor Server) versus client-side in the browser on a WebAssembly-based . NET runtime (Blazor WebAssembly, Blazor WASM).
Blazor is very fast in terms of build and debugging.
I ran into the same thing. Since your URL contains https://localhost
, the underlying issue might the same as in my case: the certificate served by the debugger proxy is unverified, and Chrome appears to quietly refuse to connect as a consequence. (I would therefore argue Chrome's error message is, at best, misleading, and possibly just incorrect.)
Long story short, try loading your Blazor site from the http
(non-SSL) endpoint before launching the debugger.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With