Guy
Guy

Reputation: 67380

Why would breakpoints in VS2008 stop working?

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

Answers (6)

Tyler
Tyler

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

Jack Marchetti
Jack Marchetti

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

Nick Randell
Nick Randell

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

Guy
Guy

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

FlySwat
FlySwat

Reputation: 175713

  • Attach the debugger to ASP.NET process and click on the modules window. Ensure that debugging symbols are loaded for the assemblies you want to debug.
  • Make sure the UI is referencing the debug assemblies, not release assemblies.
  • Make sure the .PDB files are in the /bin/debug/ directory
  • Make sure you rebuild the entire solution before attaching the debugger.
  • If the data tier is in a seperate solution, add the project to the UI SLN (You don't need to add a reference, those should already be established or your code wouldn't compile), so that the debugger can pull up the full code.

Upvotes: 1

Iain Holder
Iain Holder

Reputation: 14262

Have you tried deleting your bin directories before recompiling?

Upvotes: 0

Related Questions