“异常被调用的目标抛出”错误(mscorlib) [英] "Exception has been thrown by the target of an invocation" error (mscorlib)

查看:1877
本文介绍了“异常被调用的目标抛出”错误(mscorlib)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 目标已经抛出异常在生产环境中调用

。这不是在开发中抛出这个错误。



源是'mscorlib',堆栈跟踪说

  System.RuntimeMethodHandle._InvokeMethodFast。 

自从我上次上传到制作以来,我唯一改变的是我已经开始使用会员控件(Login,LoginView),并添加了更多的存储过程和表等。成员资格取决于我写的定制提供者。



任何人都有为什么会发生这种情况?

解决方案

我建议检查一个内部异常。如果没有,请检查您的日志是否在此之前发生的异常。



这不是一个特定于Web的异常,我也在桌面应用程序开发中遇到它。简而言之,正在发生的是接收这个异常的线程正在运行一些异步代码(通过Invoke()),而异步运行的代码正在爆发异常。此目标调用异常是该失败的后果。



如果还没有,请在您正在调用的异步回调中放置一些异常记录包装器触发此错误。事件处理程序,例如。这应该可以帮助您追踪问题。



祝你好运!


I have a website developed in ASP.Net 2.0 that is throwing the error

"Exception has been thrown by the target of an invocation" 

in the production environment. It was not throwing this error in development.

The source is 'mscorlib', and the stack trace says the error at

System.RuntimeMethodHandle._InvokeMethodFast.

The only thing I've changed since my last upload to production is that I've started using Membership controls (Login, LoginView), and have added a few more stored procedures and tables, etc. The membership depends upon a custom provider I've written.

Anybody have a clue why this could be happening?

解决方案

I'd suggest checking for an inner exception. If there isn't one, check your logs for the exception that occurred immediately prior to this one.

This isn't a web-specific exception, I've also encountered it in desktop-app development. In short, what's happening is that the thread receiving this exception is running some asynchronous code (via Invoke(), e.g.) and that code that's being run asynchronously is exploding with an exception. This target invocation exception is the aftermath of that failure.

If you haven't already, place some sort of exception logging wrapper around the asynchronous callbacks that are being invoked when you trigger this error. Event handlers, for instance. That ought to help you track down the problem.

Good luck!

这篇关于“异常被调用的目标抛出”错误(mscorlib)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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