Skip to content

Unable to debug client-side Blazor WebAssembly hosted by ASP.NET Core inside a Docker container #22092

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
minameismud opened this issue May 21, 2020 · 1 comment
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly

Comments

@minameismud
Copy link

Visual Studio 2019 16.6, Blazor 3.2, Edge 81.0.416.77

Starting with a new Blazor WebAssembly App, checking the ASP.NET Core hosted option, verify the debugging steps on the MSDN Blazor WA debugging page work (ie. stick a breakpoint on line 14 of Counter.razor, run app, verify breakpoint is hit when the button is clicked). This works for me.

Right click the server project, Add -> Docker Support (Linux OS). Try the debug test again. Breakpoint is not hit. Is this because the remote debugging port isn't being exposed on the container?

When I hit Shift+Alt+D in my browser, it tries to load http://127.0.0.1:37557/?url=https%3A%2F%2Flocalhost%3A32770%2F but fails with ERR_CONNECTION_REFUSED in the browser. If I stop and restart debugging, hit Shift+Alt+D again, the port off 127.0.0.1 changes. Is there a setting I can apply to set that remote debugging port to a fixed value so I can expose it in the docker startup?

@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels May 21, 2020
@javiercn
Copy link
Member

@minameismud thanks for contacting us.

This is a current limitation we are aware of. The issue is caused due to the fact that the proxy server runs within the asp.net core host inside the container.

We are looking how we can improve the experience in the future, but for the time being we recommend you debug outside the docker container.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly
Projects
None yet
Development

No branches or pull requests

2 participants