-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Unable to debug Blazor hosted webassembly 5.0.2 from Visual Studio 2019 16.8.4 #29714
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
Comments
@pmeems thanks for contacting us. Something weird is going on with the VS Debugger I think. @captainsafia do you know who the right folks to talk about this are? I would suggest you close VS and try to remove the .vs folder to see if that helps |
Thanks @javiercn I just closed VS, deleting the .vs folder and tried again. |
Thanks for the info, @pmeems. It looks like you've identified two different issues in the PR. The first is the webpage not automatically loading after pressing F5 and the second is the error you receive when opening in IE.
|
I didn't realize the IE part. Current versions of Blazor don't support Internet Explorer. Only Microsoft Edge. |
@javiercn Ah, right you are. I always get groggy on our supportability matrix. But luckily there's a website for that: https://docs.microsoft.com/en-us/aspnet/core/blazor/supported-platforms?view=aspnetcore-5.0. Another thing I'd recommend is to see if you can reproduce the issue with debugging when starting the app on a Kestrel server. |
I know IE isn't supported I just tried it and noticed the javascript errors. Perhaps they shed some light on the problem.
|
@pmeems if you can repro these issues with a supported browser, we can look into this further. |
No need for a separate repo. I just created a new project using the Blazor WASM template of VS2019, enabled Hosting, and ran it. @mkArtakMSFT Could you confirm using the template will reproduce the problem? If not it might be something else on my pc. |
@pmeems seems like you are either using a preview version of the SDK or a preview version of Visual studio. Can you try to setting up the SDK to a well-known version and using a released version of Visual Studio? ( Do you see any errors in the console when you open it with a supported browser? (Latest Edge for example). @captainsafia can you route this to the right folks? |
Thanks @javiercn, adding that global.json helps. Debugging however is still not working. I've added a breakpoint at the OnClick-event of the Counter page but it never gets triggered. I do get the warning in VS 'Berakpoint set but not bound' |
@pmeems Can you file an issue for this using the "Report a problem" UX in VS? Also, just to confirm: it appears that debugging is working for both non-Auth and Auth apps with kestrel? |
Let me summarize: I've got a Blazor Server application, which I've been working on for months. This app runs in IIS Express and is debuggable. I also have a Blazor WASM Core Hosted app with Azure B2C authentication, just started last week, my first Blazor WASM app. When running the Server project with IIS Express I can't get past the I also created a new Blazor WASM Core Hosted app without auth, using the VS template.
Now I can run the Server project with IIS Express but I still can't debug. All packages used by my projects are up-to-date. As requested I also reported this as a problem at https://developercommunity2.visualstudio.com/t/Unable-to-debug-Blazor-hosted-webassembl/1327806 |
Thanks for contacting us. |
Few things I found when investigating this:
|
@BrennanConroy and I synced on this yesterday. For #1, we'll sync with the VS team to understand why the launch behavior differs between IIS Express and Kestrel. Getting IIS Express to load the symbols before launching the app server would improve startup perf for the app. For #2, it appears that the proxy might be trying to communicate with a browser that connection that is no longer valid. The cache #3 is expected behavior. For #4, we need more logging from the DebugProxy. |
I too have a Hosted Blazor WASM solution and am unable to debug code behind files. I've tried this in Visual Studio Pro 2019 Version 16.8.5 and Visual Studio Pro 2019 Preview Version 16.9.0 Preview 4.0. I tried repairing the installs as well as deleting the .vs folder. I've run in Kestrel and IIS Express. No luck no matter what I do. |
@devlife I would recommend opening a new issue with the relevant details so we can work through your particular problem. Thanks! |
Closing this since there's nothing actionable on our end here. The runtime team has added more logging to the DebugProxy for .NET 6. Reached out to VS about improving launch semantics for IIS Express. |
Describe the bug
I'm running into the same issues as reported in #22911
I'm running v5.0.200-preview.20614.14, using VS Studio 2019 Community v16.8.4
I have the same issues when running VS Studio 2019 Community Preview v16.9.0 Preview 3.0
When hitting
F5
in VS the blank about page is opened and nothing is loaded.When manually type in
https://localhost:44356/
the app starts.This happens when opened in Chrome and in Edge.
When opening in IE I get these Javascript errors:
JavaScript critical error at line 1, column 1399 in https://localhost:44356/_content/Microsoft.Authentication.WebAssembly.Msal/AuthenticationService.js\n\nSCRIPT1002: Syntaxis Error
JavaScript critical error at line 1, column 1723 in https://localhost:44356/_framework/blazor.webassembly.js\n\nSCRIPT1002: Syntaxis Error
To Reproduce
I just started a fresh Blazor WASM app running the tutorial at https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory-b2c?view=aspnetcore-5.0
Basically the command I used is:
dotnet new blazorwasm -au IndividualB2C --aad-b2c-instance "{AAD B2C INSTANCE}" --api-client-id "{SERVER API APP CLIENT ID}" --app-id-uri "{SERVER API APP ID URI}" --client-id "{CLIENT APP CLIENT ID}" --default-scope "{DEFAULT SCOPE}" --domain "{TENANT DOMAIN}" -ho -o {APP NAME} -ssp "{SIGN UP OR SIGN IN POLICY}"
Further technical details
dotnet --info
Tried with
VS Studio 2019 Community v16.8.4
andVS Studio 2019 Community Preview v16.9.0 Preview 3.0
The text was updated successfully, but these errors were encountered: