gpt4 book ai didi

c# - UnobservedTaskException - 任务从哪里来

转载 作者:行者123 更新时间:2023-11-30 18:22:41 24 4
gpt4 key购买 nike

在我的 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 事件,或许可以获得有关异常的更多信息。

关于c# - UnobservedTaskException - 任务从哪里来,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33698395/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com