Reputation: 67380
I have a c# asp.net web app. Breakpoints in the database layer are no longer stopping execution but the breakpoints in the UI layer are still working okay. Can anyone hazard a guess why this might be happening?
I've checked all the usual suspects (Debug build is on for all projects) and recompiled all projects in solution...
Upvotes: 2
Views: 2799
Reputation: 3200
I would ensure that the UI layer is referencing the appropriate 'debug' .dll's. I'd also consider pressing CTRL+ALT+U (Modules View
) when you're debugging to see if symbols are loaded for your BLL and DAL .dlls
. If not then Visual Studio is unable to find .PDBs
for that file.
Are debug files .PDBs
in the same directory as the .dlls
that are being referenced from the Modules window?
Upvotes: 1
Reputation: 15754
I had the same issue and kept thinking "what did I change in web.config" to potentially do this?
<location path="." inheritInChildApplications="false">
That was not allowing breakpoints to work for me.
Upvotes: 0
Reputation: 18315
A couple of suggestions. The first one is to check the status of the breakpoint in the source line. Is it a solid red ball? If not, it generally indicates that the file in question isn't the one used for the build. Secondly - have a look at the modules view and see what module and symbols have been loaded. You may find it's not what you expect.
As for why - I've no idea!
Nick
Upvotes: 1
Reputation: 67380
Thanks for the responses and ideas guys - I had already tried all of those or variations of them.
I think that it must be a very subtle VS bug. A colleague suggested I make the function that I was trying to break on public (previously "undefined" so was implicitly private) and try again. I did this and the breakpoint started to get hit. I then removed the public keyword and the breakpoint continued to be hit. No idea why this solved it but it did.
Thanks for you help!
Upvotes: 1
Reputation: 175713
Upvotes: 1
Reputation: 14262
Have you tried deleting your bin directories before recompiling?
Upvotes: 0