Search code examples
asp.netwpfvisual-studiodebugging

VS 2022: Breakpoint will not currently be hit. No symbols have been loaded for this document


I have a VS 2022 solution with a WPF client and ASP.NET backend and when I put breakpoints in the backend web services they have the yellow tag with a message:

Breakpoint will not currently be hit. No symbols have been loaded for this document.

I run the solution with the WPF project set as the start project, but, if I test this by setting the web project as the start project - the symbols will load, but of-course this is useless as the wpf app is not running.

A little history: This solution was running on my old dev PC (same version of everything) and all worked as expected, but when loading all solutions onto my new PC, this problem started up. I have googled this and found a ton of posts about it and have tried everything, but nothing has worked yet.

I can run the solution and attach to the process and then debug, but since I will be debugging 100s and 100s of times, those extra steps are a real pain and I have been able to debug asp.net projects from wpf for many years up to now.

Can someone please recommend some additional steps I can take to solve this problem?

FYI, I Have been through everything from this link:

How do I remedy "The breakpoint will not currently be hit. No symbols have been loaded for this document." warning?

Thanks.


Solution

  • Common method:

    In VS, go to Tools --> Options --> Debugging --> General, and then cancel the checks in front of [Enable "Only My Code"] and [Require source files to exactly match the original version]. But this method you may have tried.

    Ultimate method:

    When the breakpoints clicked by the mouse are invalid, you can perform the following operations in vs: Debug --> delete all breakpoints Debug --> New Breakpoint --> Function Breakpoint, and then enter the name of the function to add a breakpoint

    enter image description here

    enter image description here