问题
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://docs.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?
回答1:
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.
来源:https://stackoverflow.com/questions/56246560/blazor-client-side-debugging-fails