Edit: Visual Studio 2015\'s new exception window is so much faster than the old dialog that I no longer care as much about using a keyboard shortcut for i
I have created a free Visual Studio extension that can do that reliably: Exception Breaker.
It uses undocumented IDebugSession2.SetException
call that is very fast: all exceptions are set/unset in 20 to 60 milliseconds.
Just offering some info I found on this (here) as I was scouring the net in my futile attempt to help...
Someone else posed this same question and it was responded to by Gary Chang from MS Support, here's the quoted response:
I am afraid the Macro code cannot manipulate the operations on the Exceptions dialog box...
It's important to note that this posting is from December of 2005 so this response may no longer be accurate; either way, thought I'd throw it out there.
The suggestion of setting the special ExceptionSetting for the group does indeed toggle the state of the top-level checkbox. However, it doesn't seem to toggle the individual Exceptions below it in the tree, and moreover, my process does not stop when such exceptions are thrown as it does if I manually check the top-level checkbox. Do you see different behavior?
Here's Bryce Kahle's very useful macro blindly updated to run in VS2010:
Sub ToggleExceptions()
Dim dbg As EnvDTE100.Debugger5 = DTE.Debugger
Dim exSettings As ExceptionSettings = dbg.ExceptionGroups.Item("Common Language Runtime Exceptions")
Dim exSetting As ExceptionSetting
Try
exSetting = exSettings.Item("Common Language Runtime Exceptions")
Catch ex As COMException
If ex.ErrorCode = -2147352565 Then
exSetting = exSettings.NewException("Common Language Runtime Exceptions", 0)
End If
End Try
If exSetting.BreakWhenThrown Then
exSettings.SetBreakWhenThrown(False, exSetting)
Else
exSettings.SetBreakWhenThrown(True, exSetting)
End If
End Sub