Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Blazor client side web debugging fails to function when run within IIS #101554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
xantari opened this issue Apr 25, 2024 · 7 comments
Closed
1 task done

Blazor client side web debugging fails to function when run within IIS #101554

xantari opened this issue Apr 25, 2024 · 7 comments
Assignees
Labels
area-Debugger-mono tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly
Milestone

Comments

@xantari
Copy link

xantari commented Apr 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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.

visualstudio-js-debugger.txt

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: #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

  1. Take attached project and extract it to C:\TFS\BlazorApp1
  2. Setup a web application in IIS with a legitimate SSL certificate attached to it and point it to the C:\TFS\BlazorApp1 folder
  3. Set your local hosts file to resolve a valid domain to that SSL certificate so that it resolves on your local machine.
  4. 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).
  5. Attempt to launch "IIS (LocalDevelopment) - localdev.arrt.org". Your browser should hang.

Exceptions (if any)

image

.NET Version

.NET 8.0.3

Anything else?

Visual Studio 2022. 17.9.6

Sample Project

BlazorApp1.zip

@javiercn javiercn transferred this issue from dotnet/aspnetcore Apr 25, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 25, 2024
Copy link
Contributor

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

@tommcdon tommcdon added this to the 9.0.0 milestone Apr 30, 2024
@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label Apr 30, 2024
@thaystg
Copy link
Member

thaystg commented Jun 17, 2024

Is this happening yet?

@thaystg
Copy link
Member

thaystg commented Jun 28, 2024

Please reopen the issue if this is sill happening.

@thaystg thaystg closed this as completed Jun 28, 2024
@xantari
Copy link
Author

xantari commented Jun 28, 2024

Sorry, I didn't respond to the first notice. Yes this issue is still happening.

@thaystg thaystg reopened this Jun 28, 2024
@thaystg thaystg modified the milestones: 9.0.0, 10.0.0 Aug 12, 2024
@tommcdon
Copy link
Member

We apologize for the delayed response! @xantari would it be possible to provide a repro for this issue? This is likely a https://github.com/microsoft/vscode-js-debug problem and so we should try to transfer this bug to that repo.

@tommcdon tommcdon added the tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly label Apr 29, 2025
@thaystg
Copy link
Member

thaystg commented Apr 29, 2025

Hi @xantari I just saw that there is a repro here, can you please close the issue here and reopen it on the repo that Tom suggested please?

@xantari
Copy link
Author

xantari commented May 1, 2025

Copied it over there. Closing this one.

@xantari xantari closed this as completed May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Debugger-mono tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly
Projects
None yet
Development

No branches or pull requests

3 participants