Breakpoint not hooked up when debugging in VS.Net

2019-01-18 07:31发布

Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints are not connected. Error indicates that the compiled code is not the same as the running version and therefore there's a mismatch that causes the breakpoint to be disconnected.

Cleaned solution of all bin file and re-compile doesn't help. Not just happening on a single box or person either.

Added Note: This solution is in TFS for Source Control. If I delete my local TFS repository and get it from source control from scratch, SOMETIMES the problem goes away. I've also tried un-installing and re-installed Visual Studio. That also SOMETIMES helps. That fact that both of those work some of the time indicates that the problem isn't caused by either directly.

12条回答
等我变得足够好
3楼-- · 2019-01-18 07:56

In Options -> Debugging you can uncheck "require source files to exactly match the original version", which may help.

查看更多
冷血范
4楼-- · 2019-01-18 07:59

Is the build configuration set to Release?

Do you have a reference to an external DLL where the breakpoint is set?

查看更多
ら.Afraid
5楼-- · 2019-01-18 08:03

AviewAnew - had already done that at the request of the MS tech person. It didn't help to uncheck require source file to match version.

Mike L - configuration is set to DEBUG and there are now external DLL. Using all local projects except framework references.

查看更多
来,给爷笑一个
6楼-- · 2019-01-18 08:05

In the past I have sometimes found that switching off compiler optimisations can solve 'missing' breakpoints, as the optimiser had determined (correctly) that the code was not being called, and removed them from the compiled versions.

This does sound like a different issue, but it might be worth making sure that optimisation is switched off in Debug mode. [Project / Properties, Build settings tab]

查看更多
仙女界的扛把子
7楼-- · 2019-01-18 08:11

Do you have a post build step that touches your binaries in any way? If so, this can confuse the debugger and make it look like your symbols don't match your exe/dll because of the incorrect size/timestamp.

查看更多
登录 后发表回答