Can't Insert Breakpoint

Can't Insert Breakpoint

When trying to debug a program using breakpoints, I get an error message saying "One or more breakpoints cannot be set and have been disabled. Execution will stop at the begining of the program."

The odd thing is that with the same breakpoint and program the error may or may not appear. Is there a logical reason why this error occurs? Thanks

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I have seen 2 reasons for this:

1- You try to start debugging while you have the Release as Active Configuration. (To see which configuration is active you should have the "Select Active Configuration" box in your toolbar. Go to Tools | Customize | Category: Build, and drag the active configuration box to the toolbar).

2- You have the debug configuration as the active one, but you have just edited the code in a way that some breakpoints are now located where it is not possible to set a breakpoint. Remove all breakpoints (by pressing Ctrl+Shift+F9 or by clicking on the button with 2 hands and a red cross which you find to drag to the toolbar at Tools | Customize | Category: Debug) and set new breakpoints.



Another (annoying) situation is when you have, say, multiple projects in the same workspace. When you debug one inserting breakpoints in its source files, then switch to another and debug it, VS will disable the breakpoints you've just set in the first. Heck, can't it just ignore them?

As Sabalan recommended, "Remove all breakpoints" is a useful button.
I'd just add that you can get list and properties of all breakpoints on Ctrl+B
(DebugBreakpoints if I remember correctly).



Leave a Comment

Please sign in to add a comment. Not a member? Join today