鼠标放到失效断点上,会弹出一些英文,告诉你如果解决这个问题:
The breakpoint will not currently be hit.The source code is different from the original version.
To allow the breakpoint to be hit when the source code is different,right-click on the breakpoint,
Choose ‘location…’,and turn on ‘Allow the source code to be different from the original version.
To allow this for all breakpoints,disable the option ‘Require source files to exactly match the original version’ under Tools,Options,Debugging,General.
我们这里直接点击失效断点的右键菜单选“location”,在Allow the source code to be different from the original version.的方框上
点击一下,添加个勾就行。
在运行至断点处时会提示“The source file is different from when the module was built.Would you like the
debugger to use it anyway?”,选下面的“是(Y)"按钮就可以了,程序会跳到断点处。
本文介绍了当遇到Visual Studio中设置的断点变为失效状态时的解决办法。文章提供了详细的步骤来帮助开发者允许源代码与原始版本不同,并确保即使在源文件发生变化的情况下也能成功命中断点。
1833

被折叠的 条评论
为什么被折叠?



