Programmatically apply / deactivate breakpoints in Visual Studio

前端 未结 5 1900
星月不相逢
星月不相逢 2020-12-08 05:27

Regardless of other options that may achieve the same result (i.e. adding breakpoints by hand), is it possible to programmatically add a breakpoint into the source code of a

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 05:57

    You can just call System.Diagnostics.Debugger.Break().

    You can also tell Visual Studio to break on all exceptions, even handled ones, by going on the menu to Debug->Exceptions... and checking Thrown everywhere that's currently only checked "User-unhandled".

提交回复
热议问题