Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 871
spacedog Avatar asked Oct 18 '25 08:10

spacedog


2 Answers

My solution was to remove the upper folder '.vs' next to the solution file '.sln' and all the files in folder 'debug'

like image 149
Xavier Junqué Avatar answered Oct 21 '25 00:10

Xavier Junqué


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

like image 37
Wenbin Geng Avatar answered Oct 21 '25 01:10

Wenbin Geng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!