Use something like this:
Dim dbg As EnvDTE90.Debugger3 = DTE.Debugger Dim exSettings As EnvDTE90.ExceptionSettings = dbg.ExceptionGroups.Item("Common Language Runtime Exceptions") Dim exSetting As EnvDTE90.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
It will successfully check the top-level check box in the Exceptions dialog box.
source share