aspnetcore
aspnetcore copied to clipboard
Debug blazor in vscode prompted "cannot launch browser: The URL's protocol must be one of "ws","wss:, or "ws+nuix;"""
My launch.json:

The chrome is opened, but displays blank page.
@LZD121 thanks for contacting us.
@TanayParikh can you take a look at this?
To learn more about what this message means, what to expect next, and how this issue will be handled you can read our Triage Process document. We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. Because it's not immediately obvious what is causing this behavior, we would like to keep this around to collect more feedback, which can later help us determine how to handle this. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact work.
I have the same problem since time ago. I assumed it was a local problem. In VS2022 everything works fine. In VSCODE the debug does not work well. I had the problem with .NET6, I upgraded to .NET7 and the problem is still the same.
With edge there is no difference.
While I wait for a solution I debug with the chrome developer tools. It more or less meets my needs, at moment. Workarround steps in windows command line: dotnet run "chrome-path\chrome.exe" --remote-debugging-port=9222 --user-data-dir="user-data-path\AppData\Local\Temp\blazor-chrome-debug" scheme://localhost:port/ And now in chrome: shift+alt+D. Then debug blazor in file://
Thanks @LZD121 !
You'll need to add the inspectUri property. Please see the documentation here for more information.
Marking this as resolved. Please let us know if you're still experiencing this issue after following the guidance in the documentation above.
Hi, @TanayParikh thanks. I have followed all the steps of the documentation but it does not solve the problem.
I do the tests by creating a clean project.

More info,
With Microsoft.AspNetCore.Razor.VSCode.BlazorWasmDebuggingExtension v1.1.0 and v1.0.1 the same error happens.
But, with Microsoft.AspNetCore.Razor.VSCode.BlazorWasmDebuggingExtension v1.0.0 apparently it launches the browser fine, and the debug proxy connects. I only comment this in case it helps you, since version 1.0.0 fails for other reasons.
cc/ @thaystg in case you have context on this issue
Yes, this is fixed in this PR: https://github.com/dotnet/razor/pull/7929 We need to merge it and ship it, I'm not sure how to do it :)
Thanks @thaystg
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.
See our Issue Management Policies for more information.
I don't believe this issue is resolved because I am experiencing it now in VSCode using the blazorwasm template with no modifications. I get the same "Unable to launch browser" issue.
The issue has been resolved via the PR mentioned above. The code hasn't yet shipped so you'll still be seeing the older behavior for now.
I have the same issue.
- I start Edge in the debugger - no page is loaded
- I insert manually the url of my project into the Edge debugger
- Blazor wasm app loads
- After a short time the Edge in debugger stops working and quits.
- I see the error message above
When will be the fix shipped?