UnobservedTaskException - 哪里任务从何而来 [英] UnobservedTaskException - Where did the task come from

查看:667
本文介绍了UnobservedTaskException - 哪里任务从何而来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的MVC应用程序,我有时会像一个例外:

In my MVC application, I sometimes get an exception like:

System.Net.WebException: The request was aborted: The request was canceled.
   at System.Net.HttpWebRequest.BeginGetRequestStream(AsyncCallback callback, Object state)
   at System.Net.Http.HttpClientHandler.StartGettingRequestStream(RequestState state)
   at System.Net.Http.HttpClientHandler.<>c__DisplayClass4.<PrepareAndStartContentUpload>b__0(Task task)
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---

编辑
这里是另一种我所看到的:

EDIT Here's another kind I'm seeing:

System.Exception: Unhandled Task Error ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
   at System.Web.HttpApplication.ResumeStepsFromThreadPoolThread(Exception error)
   at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---

下面是我在事件日志中看到,但它不完全在时间和数量相关。

Here's what I see in the event log, but it's not exactly correlated in time or count.

A fatal alert was generated and sent to the remote endpoint. This may result in termination of the connection. The TLS protocol defined fatal error code is 40. The Windows SChannel error state is 1205.

An TLS 1.2 connection request was received from a remote client application, but none of the cipher suites supported by the client application are supported by the server. The SSL connection request has failed.

/ EDIT

/EDIT

有没有一种方法来识别异常的源/位置或获取有关异常来自何处的任何其他信息?

Is there a way to identify the source/location of the exception or get any other information about where the exception came from?

编辑2
这里是另外一个我看到。他们都涉及到OnAsyncHandlerCompletion,但我不知道来源是什么。

EDIT 2 Here's another one I'm seeing. They're all related to OnAsyncHandlerCompletion, but I'm not sure what the source is.

System.Exception: Unhandled Task Error ---> System.NullReferenceException: Object reference not set to an instance of an object.
at System.Web.HttpApplication.get_CurrentModuleContainer()
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.ResumeStepsFromThreadPoolThread(Exception error)
at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---

/ EDIT 2

/EDIT 2

推荐答案

您可以订阅 TaskScheduler.UnobservedTaskException 事件,也许获得有关异常的更多信息。

You can subscribe to the TaskScheduler.UnobservedTaskException event, and perhaps get more information about the exception.

这篇关于UnobservedTaskException - 哪里任务从何而来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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