Skip to content

Blazor Webassembly can not debug with Visual Code #21166

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
hieuluong1989 opened this issue Apr 24, 2020 · 11 comments
Closed

Blazor Webassembly can not debug with Visual Code #21166

hieuluong1989 opened this issue Apr 24, 2020 · 11 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly investigate Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity

Comments

@hieuluong1989
Copy link

I tried to set up debugging of Blazor Webassembly following this document.
https://docs.microsoft.com/en-us/aspnet/core/blazor/debug?view=aspnetcore-3.1#visual-studio-code

Describe the bug

When I press Debug (Blazor StandAlone), it does not handle my break point. My breakpoint was not red, it was circle with grey color.

image
image

To Reproduce

  1. Create new blazor webassembly
  2. Open visual code, install extension C# and JavaScript Debugger (Nightly), check checkbox Use the new in-preview Javascript debuger for Node.js and Chrome
  3. Add the required assets to the app for building and debugging. Select Yes:
  4. updated, the launchSettings.json
  5. Set breakpoint on razor file
  6. Start debug Blazor StandAlone, Start debug Blazor Webassembly in Chrome

Further technical details

  • dotnet core: 3.1.201
  • Microsoft.AspNetCore.Components.WebAssembly.Templates: 3.2.0-preview4.20216.8
  • C# extension: 1.21.17 (current)
  • JavaScript Debugger (Nightly): 2020.4.2317 (current)
  • Chrome: Version 81.0.4044.122 (Official Build) (64-bit)
@mkArtakMSFT mkArtakMSFT added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Apr 24, 2020
@mkArtakMSFT
Copy link
Contributor

Thanks for contacting us.
Can you please try to debug in browser and see whether that works?

@SteveSandersonMS
Copy link
Member

Instructions for debugging in the browser are here: https://docs.microsoft.com/en-us/aspnet/core/blazor/debug?view=aspnetcore-3.1#debug-in-the-browser

@mkArtakMSFT mkArtakMSFT added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Apr 27, 2020
@hieuluong1989
Copy link
Author

hieuluong1989 commented Apr 29, 2020

@mkArtakMSFT:
It worked with debugging in the browser. This is my dotnet info:
image

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Apr 29, 2020
@mkArtakMSFT
Copy link
Contributor

@NTaylorMullen what can we collect to be able to investigate this issue?

@mkArtakMSFT mkArtakMSFT added investigate and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Apr 29, 2020
@NTaylorMullen
Copy link

@hieuluong1989 Could you set the setting trace: true in the launch.json pwa-chrome configuration. It'll cause the extension to capture verbose logs. The file location will be printed to the debug console, sharing that should shed some light.

@mkArtakMSFT mkArtakMSFT added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Apr 30, 2020
@ghost
Copy link

ghost commented May 4, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@hieuluong1989
Copy link
Author

@NTaylorMullen: This is the logs of ms-vscode.js-debug-nightly

vscode-debugadapter-0.json.txt

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity labels May 6, 2020
@mkArtakMSFT mkArtakMSFT added this to the 5.0.0-preview4 milestone May 6, 2020
@alderic
Copy link

alderic commented May 15, 2020

the same issue, can't load symbols.
By default in the launch.json "url": "https://localhost:5001"
In this link indicates https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-preview-3-release-now-available/ that you can use http and https.
I change my url to http://localhost:5000 and debug work fine.
mb this is due to the fact that I do not have a certificate on localhost:)

@mkArtakMSFT
Copy link
Contributor

@captainsafia reassigning this to you as you've taken this over.

@mkArtakMSFT mkArtakMSFT removed the Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. label May 22, 2020
@captainsafia
Copy link
Member

the same issue, can't load symbols.
By default in the launch.json "url": "https://localhost:5001"
In this link indicates https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-preview-3-release-now-available/ that you can use http and https.
I change my url to http://localhost:5000 and debug work fine.
mb this is due to the fact that I do not have a certificate on localhost:)

Correct. This issue occurs because you haven't trusted your local development certificates yet. These docs have more information on how to resolve this problem.

@NTaylorMullen: This is the logs of ms-vscode.js-debug-nightly

Can you share your launchj.json? From these logs, it looks like you might be working on a nested project which requires some additional configuration to map the sourcemaps correctly.

@captainsafia captainsafia added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label May 22, 2020
@ghost
Copy link

ghost commented May 26, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed May 30, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jun 29, 2020
This issue was closed.
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 investigate Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity
Projects
None yet
Development

No branches or pull requests

6 participants