在Visual Studio中调试时,有时我添加了一个断点,但它是空心的,VS说“断点目前不会被击中。”源代码与原始版本不同。”显然,这使我无法进行调试。
这条消息到底是什么意思?什么原始版本?如果我只是打开了解决方案,而没有对代码做任何更改,又怎么会有“原始版本”呢?
在Visual Studio中调试时,有时我添加了一个断点,但它是空心的,VS说“断点目前不会被击中。”源代码与原始版本不同。”显然,这使我无法进行调试。
这条消息到底是什么意思?什么原始版本?如果我只是打开了解决方案,而没有对代码做任何更改,又怎么会有“原始版本”呢?
当前回答
在我的例子中,我在VS 2012中附加了一个正在运行的进程。当附加时,你可以选择以各种模式(本机、脚本、silverlight、托管2.0、托管4.0等)进行调试。默认情况下,调试器自动选择模式。然而,自动并不总是做出正确的选择。如果进程包含多种类型的代码,请确保调试器使用的是正确的代码。
其他回答
我遇到了这个问题,这是因为我们的DevOps团队要求Azure云设置。在开发时,只需将其从Web.config中删除。
<httpRuntime maxRequestLength="102400" />
<!--TODO #5 comment out for IIS Express fcnMode goes with httpRunTime above in other environment just in DEV -->
<!--fcnMode="Disabled"/>-->
This happen often also if you are using a file references to binaries (instead of project references to code in your project), and the compiled binary that you are referencing falls out of sync with the corresponding source code on your machine. This can happen because you downloaded a new version of the binary from source control without the new source code that went with it, or you have a few versions of the binary on your machine and are referencing an old copy, etc. If this is indeed the problem, it's a good reason to use project references as much as it practical.
去
工具 选项 调试 一般
取消选中“要求源文件与原始版本完全匹配”
如果您在调试构建配置中未选中DLL项目,那么您的新代码将永远无法构建!
转到构建—>配置管理器…(在VS2010中),并检查您正在尝试调试的代码的项目是否为当前构建配置进行了检查。
在我的例子中,我在VS 2012中附加了一个正在运行的进程。当附加时,你可以选择以各种模式(本机、脚本、silverlight、托管2.0、托管4.0等)进行调试。默认情况下,调试器自动选择模式。然而,自动并不总是做出正确的选择。如果进程包含多种类型的代码,请确保调试器使用的是正确的代码。