问题
I'm using Visual Studio 2008 (C# Express Edition) and I'm trying to debug a TargetInvocationException that occurs as a result of an event that I trigger.

My question isn't specificly about this exception, (hence why I've not included any detail about this exception), but more about using the IDE effectively to debug this.
I can see the inner exception gives me the detail I need to debug the error (clicking on 'View Detail' in the exception helper), but being fairly lazy, or should I say, trying to make good use of the tools I have at my disposal, I'd like to be able to convince the IDE to show me the exception helper for original (Inner Exception) within my code for the correct thread, complete with stack trace, rather than showing me the exception details for the calling thread.
Is this possible, and if so, how do I go about doing this?
回答1:
You can tell debugger to break on CLR exception
so that you can see the exact place where it is throwing exception.
You can check it under Debug -> Exceptions
.
You can find it here -


回答2:
Exception Assistant Dialog Box might help you - http://msdn.microsoft.com/en-us/library/2ww37f14.aspx
来源:https://stackoverflow.com/questions/20452431/debugging-targetinvocationexception