Trindaz
Trindaz

Reputation: 17859

In Visual Studio 2013, why do my breakpoints occasionally "detach"?

Usually when I debug my application the breakpoints "work" just fine (execution pauses, VS 2013 gets focus so I can inspect etc.). However occasionally (roughly 1 in 10 times) the breakpoint icons on the left of each line of code change to have a red outline only (instead of red filled) and execution never stops.

All that's required to "fix" this is to stop the application and re-attempt to debug it.

Why does this happen at all? How can I stop this?

Upvotes: 2

Views: 83

Answers (1)

gbjbaanb
gbjbaanb

Reputation: 52679

Usually its because the debugger doesn't have debug symbols that are associated with the code, this can be because there are no symbols (.pdb files) in the right directory (either the one your program is running from, or the place they were built), or because they've been corrupted in some way, or because they no longer match the code (eg you changed code without a recompile to make new, matching, symbols).

From your description it sounds like code has changed without a recompile. The symbols have to match exactly you see, being slightly out of date can show you the wrong line of code or variables, which is worse than having no symbols at all.

Take a look at the Debug menu -> Windows -> Modules to get a list of all loaded dlls and whether they have symbols associated or loaded with them.

Upvotes: 1

Related Questions