VS2008无法下断点调试的原因

 

VS2008单步调试时出错,原来的断点处显示一个空心圆加一个右下角的警告图标,调试无效,会直接跳过该断点。鼠标放在该断点上有如下提示:

The breakpoint will not currently be hit. The source code is different from the original version

 

 

网上搜了一下原因,有人写:

昨天对dnn跟踪调试的时,设了断点后运行到断点处总提示“The breakpoint will not currently be hit. The source code is different from the original version”,搜了一下,原因是:

The problem you're running into is caused by a new feature in the compilers and debugger to keep track of checksums for source files. Using this mechanism we can tell if the source file we're displaying in the debugger matches the original file used to build the application.

When you change a source file while debugging, and Edit and Continue is unavailable or disabled, you'll see warnings about the source not matching. Since Beta 2 we've improved the error message (no longer a Yes/No dialog, just a warning with an OK button). We've also changed the behavior so your breakpoints will no longer show this message when a source file does not match.

To clarify what the message is asking you to do: right-click on the breakpoint in question, and you should see a Location item. On the resulting dialog you should see an override checkbox which will get rid of the message you're seeing when you hover over your breakpoints. Or you could go to Tools->Options->Debugging->General and uncheck the "Require source to exactly match..." option, which will turn off all checksum functionality in the debugger.

 

 

 

偶的英语不太好,大致上看明白了,从菜单栏的 Tools->Options->Debugging->General  

取消 "Require source to exactly match..." 项的选择。

还有两个可能是

1. 打开项目属性,选择调试选项卡,将“启用非托管代码调试”一项钩上。

2. 由于Terminal Services 这个服务被禁用了,将这个服务设为自动,将这个服务启动。

我试了一下,确实就好了。

 

 

 

最后我还是想办法解决了这个问题,方法是先取消“Require source files to exactly match the original version”选项,然后修改一下程序,再在该文件设断点调试一下,然后重新选定“Require source files to exactly……”选项,这样就好了。

最后我想,断点调试失效的原因应该是我当时调试中间的时候顺便改写了程序,导致Visual Studio 2008对此进行了记录,而后面好像又强行关掉了Visual Studio 2008,导致记录没有被清除,后面就老是通不过源文件和debbuger编译时文件的同步检测。而后面我重新设断点调试和重新选中同步测试选项相当于把错误记录又清除掉了,所以就修复啦。

 

 

 

你可能感兴趣的:(vs2008,断点失效)