microsoft / microsoft/vscode-js-debug
Blazor client side web debugging fails to function when run within IIS
@connor4312 is already working on this.
Since May 1, 2025.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 373
- Avg merge
- 1d 9m
- Merged PRs (30d)
- 6
Description
Describe the bug
When attempting to debug a local IIS hosted web application running blazor you get an error when attempting to debug the blazor razor component.
Kestrel debugging works fine. However it is broken in IIS mode when running under an SSL certificate:
Unable to launch browser: "Could not open wss://localdev.arrt.org:443/_framework/debug/ws-proxy?browser=ws%3A%2F%2F127.0.0.1%3A34840%2Fdevtools%2Fbrowser%2Fd2b99056-84ce-433a-819b-d7df11de4a00\
Currently the only work around is to remove the following from the launchSettings.json, but then blazor components using WebAssemblyPrerendered are no longer able to be debugged.
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
Here is the log indicating it is unable to open a websocket connection.
NOTE: IIS does have Websocket Protocol enabled in windows, so that is not the issue. Other websocket activities work fine, just not the debugging using inspectUri parameter.
This may be related to this issue: https://github.com/dotnet/runtime/issues/96239
However the fix indicated in that issue does not work for me. This is the fix recommended (updated example to LocalDevelopment):
<DebuggerSupport Condition="'$(Configuration)' == 'LocalDevelopment'">true</DebuggerSupport>
Expected Behavior
Client side debugging should work without issue. The "inspectUri": "{wsProtocol}://{url.hostname}:443/_framework/debug/ws-proxy?browser={browserInspectUri}" line should also work without issue when running within IIS under an SSL certificate.
Steps To Reproduce
- Take attached project and extract it to C:\TFS\BlazorApp1
- Setup a web application in IIS with a legitimate SSL certificate attached to it and point it to the C:\TFS\BlazorApp1 folder
- Set your local hosts file to resolve a valid domain to that SSL certificate so that it resolves on your local machine.
- Update the launchSettings.json to use your domain (in the sample it is set to localdev.arrt.org, you would want to change it to your valid domain).
- Attempt to launch "IIS (LocalDevelopment) - localdev.arrt.org". Your browser should hang.
Exceptions (if any)
.NET Version
.NET 8.0.3
Anything else?
Visual Studio 2022. 17.9.6
Sample Project
VS Code Version: N/A (Visual Studio 2022, 17.9.6)
Additional context
Originally opened here but was told to move it over here: https://github.com/dotnet/runtime/issues/101554
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.