41

When debugging, changes to breakpoints are only persisted for that debugging session. Once the debugger detaches the breakpoints are restored to their 'pre-debug' state.

I can appreciate this is sometimes useful, and understand why it defaults this way.

However - does anyone know if there is an option to disable this functionality (in VS2010) such that if I delete/disable/add a breakpoint during debugging the changes will persist the next time I start debugging?

Michael Shimmins
  • 19,961
  • 7
  • 57
  • 90

2 Answers2

9

You can remove the breakpoint whilst debugging by using the Breakpoint Management Window (Debug -> Windows -> Breakpoints).

From there you'll be able to remove the breakpoint in question by right clicking the relevant breakpoint and hitting 'delete'.

Jamie Dixon
  • 53,019
  • 19
  • 125
  • 162
  • 1
    Yup - but then hit F5 again and its back. – Michael Shimmins Jan 03 '11 at 00:39
  • 1
    Once you remove the breakpoint from the manager (by right clicking and hitting delete, rather than simply unchecking it) you should find it's a perminent delete. – Jamie Dixon Jan 03 '11 at 00:41
  • 3
    @Jamie Dixon: When you hit a breakpoint during debugging and disable it with F9 it will be enabled again when you restart the debugging. This is sometimes really annoying. I don't want to go to the breakpoint manager when I'm deeply concentrated in debugging. – Sani Huttunen Jan 03 '11 at 00:43
  • Fair enough Sani. As far as I know, the breakpoint will only be enabled again if there are other breakpoints due to be hit. If it's the only or last breakpoint being hit then removing it will perminently remove it. Either way these answers I've provided don't help you much. As far as I'm aware and a quick search on the Microsoft site have provided, it doesn't seem that it's possible to disable this 'feature'. – Jamie Dixon Jan 03 '11 at 00:47
  • Thanks - works for me. Probably ideal too, since usually I want to remove the breakpoint only for the remainder of this debugging session. Using the breakpoints window to remove it for good isn't inconvenient enough to make it an issue for the way I'm using it. Cheers - you've made my day :) – Michael Shimmins Jan 03 '11 at 01:28
  • note that the breakpoint window isn't available in express versions. =( – Matthew Lowe Sep 11 '12 at 15:31
  • To me this feels more like a workaround (even though OP seems happy with it). What's desired is a settings option that allows "hard removal" of breakpoints in debug session the way you would in normal mode. – Anders Feb 28 '13 at 11:02
  • I have on my VS2012 with Resharper a shortcut Alt-F9,D to delete a breakpoint permanent. I don't know if it is VS or Resharper that has created it; I know for sure it is not be because Alt-F9,D is both impossible to remember and weird to press on a keyboard. Also note that the shortcut doesn't always kick off but I have solved it by pressing F9 to remove the breakpoint temporarily and then set it back again with F9 and then Alt-F9,D to permanently remove it. This unset-set makes Alt-F9-D work more stable. – LosManos Nov 16 '13 at 21:05
  • I'd also love it if there was a genuine permanent solution to this. If it's a 'feature' then there should at least be a way to disable it. 99% of the time when I delete a breakpoint during debugging, I want it gone for good, I don't want it to re-appear again next time! Downvoted because this answer does not solve the problem the user has asked. – Will Appleby Jan 04 '17 at 14:03
-2

During debugging hit F9 on active breakpoint.

Marko
  • 20,385
  • 13
  • 48
  • 64
Milo
  • 5
  • 1