配置错误-调用目标已引发异常 [英] Configuration Error - Exception has been thrown by the target of an invocation

查看:108
本文介绍了配置错误-调用目标已引发异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了一个自定义的成员资格提供程序,我在以前的asp.net mvc应用程序中使用了它,没有任何问题.

I have built a custom membership provider that I have used in a previous asp.net mvc app with no problems.

现在,我正在尝试在asp.net Webforms应用程序中使用它,并且不断收到配置错误-调用的目标引发了异常.

Now I am trying to use it in an asp.net webforms app and I keep getting Configuration Error - Exception has been thrown by the target of an invocation.

错误页面上没有堆栈跟踪,并且我的成员资格提供程序的构造函数中的断点不会被命中.

There is no stack trace on error page and the breakpoint in my membership provider's constructor wont get hit.

我已经读到我需要检查内部异常以找出真正的问题,但是我很难做到这一点.

I have read that I need to check the inner exception to find out the true problem, but I'm having trouble getting to that point.

推荐答案

只要在动态调用的委托中引发异常,就可以发生这种情况.

This can occur any time an exception is thrown inside of a delegate which was dynamically Invoked.

委托调用调用正在捕获异常,并将其包装在新的异常中.

The delegate invoke call is catching the exception, and wrapping it in a new Exception.

当您发现此问题时,将有一个InnerException属性.这将包含从委托内部引发的原始异常.如果您调试异常,则应该可以看到此信息.例外窗口将显示此信息.另外,如果在异常处理程序中放置一个断点,则可以在本地窗口中查看异常信息,包括内部异常.

When you catch this, there will be a InnerException property. This will contain the original exception which was raised from within the delegate. If you debug the exception, you should be able to see this. The exception window will display this information. Alternatively, if you put a break point in your exception handler, you can see the exception information, including the inner exception, in the locals window.

一旦发现InnerException,您将可以访问原始错误以及原始堆栈跟踪.

Once you find the InnerException, you will have access to the original error as well as the original stack trace.

这篇关于配置错误-调用目标已引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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