0

I have a .Net web project that I publish and then attach VS to w3wp.exe for debugging. I place breakpoints, load the specific web page being modified, and debug... over and over. This works fine for a while but then it just quits hitting the breakpoints and gives the error: "breakpoint cannot currently be hit, no symbols loaded.." with a hollow circle for the breakpoint. I cannot say what causes it to stop hitting the breakpoints. I'm just coding, publishing, debugging, repeating.... then I'm not. So, I do the following:

delete all debug and release folders, delete the obj and bin folders rebuild the solution restart VS 2022 restart computer update NuGet make sure still configured for debug build

I did have some luck deleting all the files/folders in C:\Users\stever\AppData\Local\Temp\2 with today's date. In fact, I thought it WAS the fix because it fixed the issue a number of times and I was able to debug again. However, that stopped working too.

I did all the things mentioned a number of times and finally did get it to hit the breakpoints again. This has happened a lot! It sure would be nice to know what's causing this and what I need to do in order to debug again every time it happens. Any ideas for a fool-proof fix?

Velocedge
  • 1,222
  • 1
  • 11
  • 35
  • This link might help https://stackoverflow.com/questions/2155930/how-do-i-remedy-the-breakpoint-will-not-currently-be-hit-no-symbols-have-been – Housheng-MSFT May 10 '22 at 06:36
  • Most I have done (many times) and all the debug config stuff is set and never changed. But I hadn't ever deleted the .suo file. or enabled Suppress JIT optimization in options, debug. It's working again right now so I can say whether either of these work. I'll report back next time I can't debug again. – Velocedge May 10 '22 at 12:37
  • It happened again so I ONLY exited VS, deleted bin, packages, AND deleted the .suo file! Then cleared, rebuilt, published and it worked. So, that's encouraging but we'll see if it works twice in a row. – Velocedge May 11 '22 at 14:54
  • Nope... changed a bit of code and now no matter what I delete or rebuild, it won't hit the breakpoints. – Velocedge May 12 '22 at 16:59
  • Continues to work fine and the inexplicably stops. Most consistent "fix" is: (1) close VS and Chrome (2) delete Temp\2 for current day (3) delete bin, obj, packages in source (4) delete bin in target (5) Open VS and clean, rebuild solution, (6) publish (7) attach to w3wp. Sometimes have to do this whole thing a couple of more times, sometimes not. – Velocedge May 26 '22 at 20:14
  • In addition to the above, I recycle the Application Pool and restart the web site. Doing all of the above seems to get it debugging again. – Velocedge May 31 '22 at 12:45
  • Nothing here is 100% but I did find one more thing. If I do all the above and then refresh the page I'm trying to debug and quickly attach the debugger to w3wp.exe, that sometimes works. – Velocedge Aug 24 '22 at 09:06

1 Answers1

0

After a very long period of not getting this to work, I found something that works 100% for me. When I go to debug, I select "Attach to Process", then click the [Select] button for Attach To. I deselect "Automatically determine the type of code to debug" and manually select .Net 4x or .Net Core depending on what I'm debugging. Then I select the process and debug.

If it doesn't work, I stop the debugger, click [Select], and toggle "Native". Then I attach to the process again and it works every time!

Velocedge
  • 1,222
  • 1
  • 11
  • 35