I have an ASP.NET Core project that was recently updated to .NET 8.0, and now I am attempting to add a Blazor WASM project. I followed these instructions to get the project added to my existing ASP.NET Core project (copied the WASM project from a donor project).
The project is an ASP.NET Core project (MyApp) which is hosting a Blazor WASM project (MyApp.Client). The Client project has a Page with breakpoints in it. Everything is working except debugging the Client app in Visual Studio 2022.
I also created a brand new project using the "Blazor Web App" template (setup the same as the donor project I used) and it does successfully break on breakpoints, so I know the browser/environment is correct and its some sort of project configuration issue or something I did wrong when copying the donor project.
Things I've tried/confirmed:
- Hot reloading works
- Visual Studio shows the breakpoints as bound (solid red circle)
- Multiple browsers; Chrome/Edge show no errors in the console, Visual Studio reports no errors
- I have followed the official docs on debugging:
launchSettings.jsonhas the correctinspectUriMicrosoft.AspNetCore.Components.WebAssembly.Serveris referenced by the host project- Added a manual delay to
OnInitialized()to give the time for the debugger to attach (and also tested breakpoints inside of a button click with no success)
- Confirmed with the new working project:
- My browser works with debugging
- I have the same directives in
Program.cs - I have the same .NET version, NuGet packages, and startup configuration
- Deleted the bin/obj/.vs folders and restarted VS2022
- Confirmed the project is running in debug mode (I can use breakpoints in the
MyAppproject) - Confirmed the symbols for the WASM project are being loaded
System.Diagnostics.Debugger.Break();does not work either- Visual Studio is on the latest version (17.8.3)
- I CAN debug the project using the Chrome debugger (shift + alt + D)
I don't know what else to try, any suggestions on what to look for next would be appreciated.
builder.WebHost.UseUrls("https://*:1234");. But the launchsettings.json port matches ("applicationUrl": "https://localhost:1234",)'MyApp.exe' (CoreCLR: clrhost): Loaded 'C:\repos\MyProject\MyApp\bin\Debug\net8.0\MyApp.Client.dll'. Symbols loaded.Found what you were referencing, yes the symbols are loaded.