调试TargetInvocationException [英] Debugging TargetInvocationException

查看:101
本文介绍了调试TargetInvocationException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2008(C#Express Edition),并且尝试调试由于我触发的事件而发生的TargetInvocationException。

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.

我的问题是专门针对此异常((因此为什么我未包括此异常的任何细节),但更多关于有效使用IDE调试此异常的信息。

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.

我可以看到内部异常为我提供了我需要调试错误的详细信息(单击异常帮助器中的查看详细信息),但是相当懒惰,或者我应该说,试图充分利用我可以使用的工具,我希望能够说服IDE向我显示代码中原始线程(内部异常)的异常帮助程序,以获取正确的线程,并带有堆栈跟踪,而不是向我显示调用线程的异常详细信息。

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?

推荐答案

您可以告诉调试器在 CLR异常时中断。

You can tell debugger to break on CLR exception so that you can see the exact place where it is throwing exception.

您可以在 Debug->中检查它。例外

您可以在这里找到它-

这篇关于调试TargetInvocationException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆