Reputation: 4550
Often, when I have a breakpoint on some line in Visual Studio, The program will run and stop there. great. I will then click the red circle (or press F9) to remove it. Obviously I don't want my program to keep stopping there. The problem is that the next time I refresh the page the breakpoint is back! The only way to permanently remove it is to open the breakpoints window and remove it there. Why does this happen and how can I change this behavior?
I have noticed that these breakpoints which keep coming back have a little plus next to them in the breakpoints window which when you click on - open up many sub lines of breakpoints. What is the deal with that?
Thanks, Adin
Upvotes: 10
Views: 4068
Reputation: 615
Wipe the breakpoint out using the Breakpoints Window (Ctrl + Alt + B).
While debugging, when you hit the breakpoint, look at the BreakPoint window for the one that is bold.
Then, right-click it and choose Delete.
Upvotes: 0
Reputation: 2170
It appears since Visual Studio allows multiple breakpoints on a single line, i.e. in separate sub-clauses, architecturally it allows multiple identical breakpoints. The interface does not necessarily reflect this and you will see the removal of a breakpoint as graphically removing it, but not programmatically removing all instances of it.
Looking at the Debug > Windows > Breakpoints window shows for a given set of breakpoints on a line, they are stored in a sub-tree under that line item. Removing a breakpoint while watching this list will reveal the behaviour, that only one of a series of identical breakpoints is removed from the list associated with that line. By removing the breakpoint line item and with it all sub items it will completely remove all instances of the breakpoint.
Upvotes: 1
Reputation: 28463
I've post suggestion to MS to fix it: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=391642
Upvotes: 2
Reputation: 46536
The plus in the breakpoints window is there when one user-supplied breakpoint binds in multiple places. This can happen when a single file is loaded multiple times in the same debugging session, for example. The + lets you look at each of the places it bound.
@Joel: modifying breakpoints during a debugging session does not make your change temporary, although there are circumstances (like the original question), where the actual behavior can be non-obvious.
Upvotes: 3
Reputation: 2957
Helpful Key combo: to permanently delete all breakpoints, press CTRL + SHIFT + F9.
Upvotes: 16
Reputation: 416039
Just clear the breakpoint while the debugger is off. When you clear or add a breakpoint while debugging, the action only lasts for that debugging session.
Upvotes: 6