When running my application in VS2013 I get the exceptions:
A first chance exception of type 'System.InvalidOperationException' occurred in mscorlib.dll
and
A first chance exception of type 'System.InvalidOperationException' occurred in mscorlib.dll
This exceptions are caught anywhere since my application does not crash, everything works "normal". But I would really like to find the code section causing this exceptions to solve this.
What can I do to find out which part of my code throws this exception or where it happens. Is there a way to show/visualize this in VS? Debugger options?
What can I do to find out which part of my code throws this exception or where it happens. Is there a way to show/visualize this in VS? Debugger options?
In Visual Studio, choose Debug then Exceptions.
In the Exceptions window, tick Thrown on the Common Language Runtime Exceptions row.
Click OK.
Now whenever an exception is thrown, the debugger will break on the offending line. You can also expand the selection to only include the exceptions of interest.
You can find this under Debug.Windows.Exception Settings
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