Break on Exception Throw -- Setting the Default
How do you change the defaults for Visual Studio, to tell it to break on acc开发者_如何学Cess violations by default (for example)? I've tried Debug->Exceptions but it only works on a per-solution (or per-project?) basis, not globally.
Thank you!
The default is for all the exceptions to be turned off and settings are saved per solution as you described.
http://msdn.microsoft.com/en-us/library/d14azbfh.aspx
You could write a macro to turn on a default set of exceptions for you by calling SetBreakWhenThrown() on specific exception settings.
http://msdn.microsoft.com/en-us/library/envdte90.exceptionsettings.setbreakwhenthrown.aspx
macro example:
Dim eg As ExceptionSettings = CType(DTE.Debugger, Debugger3).ExceptionGroups.Item("Common Language Runtime Exceptions")
eg.SetBreakWhenThrown(True, eg.Item("System.AccessViolationException"))
精彩评论