在運行前用F9設置了斷點,但是運行后,那個斷點卻變成了空心圓和黃色感嘆號標志。
鼠標放到失效斷點上,會彈出一些英文,告訴你如果解決這個問題:
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)"按鈕就可以了,程序會跳到斷點處。