0
votes

"The breakpoint will not currently be hit. No symbols have been loaded for this document."

This is Visual Studio 2010 trying to debug a VB/ASP.Net web "site," NOT a web "application." I say that because most of the "fixes" I find on the internet involve changing project settings that don't exist for a web site project.

If I look in the modules windows when the debugger is running I'm not even sure what module I should be concerned with. If it helps I'm just trying to put a breakpoint on a button on an aspx page.

EDIT: It seems that I can hit breakpoints on all pages except for pages that use a different masterpage. For example, I have a masterpage at the root of the site that several pages use. Any of these pages work fine when I set breakpoints. But then I have folders off of the root with other pages in those folders. Some of these nested folders have their own masterpage. None of the pages that use a nested masterpage will hit breakpoints. So what does that mean?

EDIT 2: There is no "fix" for this problem because Microsoft has acknowledged that it's a bug. There are many work arounds that work for some people but not others, and I did figure out what my own problem was so I'm going to answe my own question.

3
What are you using to debug ? It is indeed a known problem (at least by me) and can be a pain in the ass (almost as much as the "circular file reference not allowed" classic compilation error)... - Laurent S.
I'm just using VS2010. Set a breakpoint, click debug. And this is the error I get. - Jimmy D
You try Cleaning/Rebuilding Solution? Closing VS and Cleaning/Rebuilding again? Often times that will fix it. - NoAlias
There is no clean for a website project. But yes, rebuild works fine. Still can't hit a breakpoint. - Jimmy D

3 Answers

1
votes

I have learned that there is no "fix" for this problem because Microsoft has acknowledged that it's a bug. People post hacky work arounds and say "Here's how to fix it" but their "fix" only works for THEM.

What I realized is that my breakpoints DO get hit, the breakpoint symbol just won't turn into a solid red dot until I actually navigate to the page where the breakpoint is while debugging!

So for example if I set a breakpoint while NOT debugging the symbol has the warning mark and says this breakpoint won't be hit. I suspect a lot of people stop right here (like I did) and try to fix the problem. Even if you launch the site in debug mode, the symbol still shows the warning. BUT as soon as you navigate to the page in the browser the symbol turns solid and the breakpoint hits. So maybe there are no debug symbols for that specific page until you navigate to it and it gets compiled? But why does that only happen with SOME pages? THAT is the bug. And I read a MS article where it was acknowledged. So good luck to everyone struggling with this annoyance.

0
votes

Try changing Active Solution Configuration to "Debug" and Solution Platform from to "Any CPU"

-1
votes

Try putting the breakpoint right at the very top of your code. Does it work there?