views:

191

answers:

3

Let's say I have 10 breakpoints and I want to clear one but not the other 9.

If I toggle the breakpoint on the one that I want to remove, it is resurrected the next time I restart the app. The only way that I know to permanently get rid of it is to clear ALL the breakpoints, which I would rather not do since I would have to reset the other 9.

Is there a better way in ANY VS version?

+3  A: 

Hitting Ctrl+Alt+B will bring up a list of all breakpoints in your solution, from which you can manually toggle or delete them with a right-click.

Dan Story
+1  A: 

Open the breakpoints window (Debug -> Windows -> Breakpoints), select the breakpoint you want to delete and press the delete key (or click the cross icon).

If you are toggling the breakpoint using the keyboard (F9 using my keyboard mappings), it sometimes doesn't remove it properly. Pressing F9 again will remove it fully (this is due to the breakpoint being set on multiple threads and toggling it whilst debugging only disables the main breakpoint but not the ones for the other threads).

adrianbanks
+2  A: 

The breakpoint's state is only temporarily altered if you change it while you're debugging and it's a multi-bound breakpoint. This is actually a feature of Visual Studio. See http://connect.microsoft.com/VisualStudio/feedback/details/391642/permanently-remove-a-breakpoint-in-visual-studio-during-debugging.

If you're not debugging, and you remove it, then it won't come back. Alternately, as others have suggested, you can remove it permanently using the breakpoint management window.

womp
I've always been able to remove breakpoints while debugging. The times it doesn't get removed (ie. its state is temporarily altered) is when the breakpoint has child breakpoints (ie. you've set a breakpoint on an overloaded function). See http://msdn.microsoft.com/en-us/library/02ckd1z7(VS.71).aspx#vctskbreakpointswindowchildbreakpoints
adrianbanks
*"The breakpoint's state is only temporarily altered if you change it while you're debugging. This is actually a feature of Visual Studio."* Can you substantiate this? This is not something i have ever noticed in all my years of using VS. I find that when VS refuses to delete my breakpoints it is because of a corrupted .user file.
slugster
http://connect.microsoft.com/VisualStudio/feedback/details/391642/permanently-remove-a-breakpoint-in-visual-studio-during-debugging - adrian is right though, it's only for multi-bound breakpoints.
womp
'bound in multiple locations' - what on earth does that mean??? two different projects calling a library class or something like that?
Simon_Weaver