Script to enable / disable violation of certain types of exceptions in Visual Studio

I am currently using the Debug → Exceptions dialog to stop using VS for certain types of exceptions. It works great. The problem is that sometimes I would like to debug these exceptions or accidentally enable or disable all exceptions, then I need to search the list and disable specific exceptions from scratch.

Is there any way to do this with a script? So that I can add any parameters to the list and switch easily, is it easy or simple?

+1
source share
1 answer

, EnvDTE.Debugger3. NullReferenceException, , :

Sub SetNullReferenceExceptionTrap()
    Dim dbg As Debugger3 = DTE.Debugger
    Dim group As ExceptionSettings = dbg.ExceptionGroups.Item("Common Language Runtime Exceptions")
    Dim except As ExceptionSetting = group.Item(GetType(System.NullReferenceException).FullName)
    group.SetBreakWhenThrown(True, except)
End Sub

, False .

+2

All Articles