Hi there.
I am sorry if this has been answered before, somehow I find it difficult to steer Google to give me answers with regards to the topic.
I am currently "procedurally" creating a WPF app. I am aware that this raises red flags for all, but down here there is no proper training available for the poor with regards to new MS technologies. I had difficulty grasping how I am going to create the kind
of UI that was required within the expected timeline without training. Ok so that being out of the way this is my main problem:
Every now and again I get the following exception on: _wpfApp.Run( _wndMain );
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Now, I have since figured out that this is sometimes caused by exceptions within those dispatch thingies. Now, "theoretically" I should not be writing code inside those dispatches that's complicated enough to cause exceptions. But unfortunately it just is not
so simple for me in practice. Maybe its because I am to lazy to spam 2 methods for basically every interaction with the UI, but I don't want to believe that.
My question is, how can I get the debugger to actually break on the line of code that causes the exception instead of floating back to Application.Run. If I have suspicions on where the exception is located I can always manually steer the debugger towards
it, so why can’t the IDE do that for me. Why does it no "step to" the problem manually like I have to do? It's driving me crazy.
Thanks for any help.
Regards
-
-
Have you looked at the InnerException? This will usually lead you to the actual issue.
-
Debug menu, Exceptions, for "Common Language Runtime Exceptions" check the "Thrown" checkbox. That'll cause the debugger to immediately break for all exceptions when they're thrown, even if they are handled somewhere.
-
Thanks allot.Sven Groot said:Debug menu, Exceptions, for "Common Language Runtime Exceptions" check the "Thrown" checkbox. That'll cause the debugger to immediately break for all exceptions when they're thrown, even if they are handled somewhere.
I will test it out and see how it works
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.