I have Visual Studio 2019 16.6.2 installed, along with the .NET Core 3.1.301 SDK and all the necessary Blazor templates.
If I create a brand new Blazor WebAssmbly application, I can run it from Visual Studio by pressing Ctrl+F5 and it opens a new tab on my active browser window and starts fine.
But when I press F5, a new, separate browser window is opened (which is midly annoying), but the page remains at about:blank
for a while until an error message appears in Visual Studio:
Failed to launch debug adapter. Additional information may be available in the output window.
Unable to launch browser:
"Could not open wss://localhost:5001/_framework/debug/ws-proxy?browser=wsAFFlocalhostA50821FdevtoolsFbrowserFceed3b95-58ac-470a-b10c-5d139cfd7117": timeout after 60000ms
Whether the Blazor WebAssembly application is "Hosted" or not doesn't make a difference.
I've followed the steps in the Enforce HTTPS in ASP.NET Core, but that made no difference.
If, while waiting for the about:blank
window to crash, I manually open the client side url on a browser tab, the app loads and the debugger breakpoints are hit.
During the short while before it goes on to crash, if I hit Shift+Alt+D I always get the following error:
Unable to find debuggable browser tab
Could not get a list of browser tabs from http://127.0.0.1:9222/json. Ensure your browser is running with debugging enabled.
Resolution
If you are using Microsoft Edge (80+) for your development, follow these instructions:
Press Win+R and enter the following:
msedge --remote-debugging-port=9222 --user-data-dir="C:\Users\sergi\AppData\Local\Temp\blazor-edge-debug" --no-first-run https://localhost:44372/
I get this each and every time, no matter how often I run the command (having closed all browser instances, rebooted, etc).
This happens in both Edge 84 (Edgium) and Chrome.
I should be able to create a new Blazor WebAssembly app and hit F5 on Visual Studio out of the box. What am I missing?
UPDATE
I've just tried using "old Edge" (EdgeHtml) and Firefox as the debug browser in Visual Studio, and both work as expected (meaning that the application at least starts up when pressing F5). The problem apears to be both Chromium-based browsers then...
UPDATE 2
@JamesHancock posted an easy enough workaround in the comments. For a full resolution (and explanation), I've logged a Github issue with the ASP.NET Core team.