簡體   English   中英

UnobservedTaskException-任務來自哪里

[英]UnobservedTaskException - Where did the task come from

在我的MVC應用程序中,有時會出現如下異常:

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 ---

編輯這是我看到的另一種:

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 ---

這是我在事件日志中看到的內容,但在時間或計數上並沒有完全相關。

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.

/編輯

有沒有辦法確定異常的來源/位置或獲取有關異常來源的其他信息?

編輯2這是我看到的另一個。 它們都與OnAsyncHandlerCompletion有關,但是我不確定源是什么。

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 ---

/編輯2

您可以訂閱TaskScheduler.UnobservedTaskException事件,並可能獲取有關該異常的更多信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM