Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blazor client side debugging fails

Tags:

blazor

When trying to debug a Blazor client side app I keep getting the error

Debugging connection was closed. Reason: WebSocket disconnected

enter image description here

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?

like image 756
Rui Lima Avatar asked May 21 '19 21:05

Rui Lima


People also ask

Why is Blazor not popular?

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.

Is Blazor client-side or server-side?

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

Is Blazor fast enough?

Blazor is very fast in terms of build and debugging.


1 Answers

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.

like image 68
Sören Kuklau Avatar answered Oct 21 '22 02:10

Sören Kuklau