I’m writing some fairly complex C# code. I’m finding that my code is throwing an exception (noted in the Output window) but the debugger isn’t breaking in. I do have Exceptions sets to break on user-unhandled CLR exceptions.
Since the debugger isn’t breaking in, I assume that there must be a try{} somewhere in the call stack.
Problem is, I can’t find it.
How do I find the exception handler for this line of code that’s throwing an exception?
Open the exceptions window in Visual Studio. Expand the appropriate tree to find the exception that is being thrown and check the “Thrown” checkbox. The next time that exception is thrown in debug mode (vice uncaught) the debugger will immediately break.