Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to break on custom exceptions in VS2015

I have several custom exceptions that are thrown throughout my application. Besides just setting a breakpoint in the constructor, is there anyway I can break on these exceptions in the same way I do with native exceptions from Exception Settings?

like image 585
William Thomas Waller Avatar asked Oct 06 '16 16:10

William Thomas Waller


People also ask

How do I break an exception in Visual Studio?

Tell the debugger to break when an exception is thrownIn the Exception Settings window (Debug > Windows > Exception Settings), expand the node for a category of exceptions, such as Common Language Runtime Exceptions. Then select the check box for a specific exception within that category, such as System.

How do I make Visual Studio not stop on exception?

Note: you can uncheck Break when this exception type is thrown directly in the exception handler and continue debugging (press F5 ). Visual Studio will add this exception type to the Exception settings and will remember that it shouldn't break on this exception again.

How do I fix unhandled exception in Visual Studio?

In Visual Studio, when exceptions are thrown or end up unhandled, the debugger can help you debug these by breaking just like it breaks when a breakpoint is hit.


1 Answers

You can add Exceptions in to the Exception Settings Window. Add it there (probably to Common Language Runtime Exceptions), then mark to break on it

like image 155
Joshua Stevens-Stein Avatar answered Nov 14 '22 07:11

Joshua Stevens-Stein