Monday, January 2, 2017

How to break when exception is thrown in C#

Sometimes during debugging an application, an unhandled exception is encountered in which we need to investigate. To find the details of this exception, we need to stop at the point of occurrence and check out the whole exception object or line of code that has a fault.
If your Visual Studio is not configured to stop on the occurrence of the exception, here is the way to turn it on:

1. Go to menu's Debug > Exceptions



2. Tick the Thrown of the CLR Exceptions

No comments:

Post a Comment