When coding in C# I like not to handle exceptions because it makes it easier to figure out where and why things went wrong. However, I can't give anyone a program that doesn't handle exceptions.
Can I somehow force Visual Studio to break on every exception, including those thrown inside try/catch blocks?
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.
VS2015 and later: Go into Debug > Windows > Exception Settings and check the tick box against Common Language Runtime Exceptions (below the 'Break When Thrown' column header).
VS2013 and earlier: Go into Debug > Exceptions and check the Thrown box against Common Language Runtime Exceptions.
You may get a lot of noise this way though, as this will also break on exceptions thrown in libraries or inside the framework itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With