Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Visual Studio 2022 Breakpoints not hit in Blazor WebAssembly using .NET 8.0

$
0
0

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.json has the correct inspectUri
    • Microsoft.AspNetCore.Components.WebAssembly.Server is 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 MyApp project)
  • 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.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>