0
我使用(C#)和(的ASP.NET Web API)和MS SQL 2008 R2开发Web应用程序和Windows Server 2008主机上IIS7,所有的API,JSONIIS停止工作
当我打电话回数据来自任何Web浏览器的任何API并在第一次调用完成之前刷新页面以再次调用它,这让我在事件查看器中发出警告,并且在0至5分钟后,II7中的工作进程停止约2分钟(挂起)并调用所有API从这些2分钟的时间段的所有用户不工作,事件查看器给我一个错误:
在事件查看器的警告
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 6/5/2012 3:29:10 PM
Event time (UTC): 6/5/2012 1:29:10 PM
Event ID: 63adcb812864465cab58e9f870bcbb92
Event sequence: 5
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2/ROOT/AAA-2-129833765408950000
Trust level: Full
Application Virtual Path: /AAA
Application Path: C:\inetpub\wwwroot\AAA\
Machine name: MyMachine
Process information:
Process ID: 9860
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: HttpException
Exception message: The remote host closed the connection. The error code is 0x800704CD.
at System.Web.Http.WebHost.HttpControllerHandler.EndProcessRequest(IAsyncResult result)
at System.Web.Http.WebHost.HttpControllerHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: My API URL
Request path: API Path
User host address: My IP
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 8
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Web.Http.WebHost.HttpControllerHandler.EndProcessRequest(IAsyncResult result)
at System.Web.Http.WebHost.HttpControllerHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
在事件查看器中的误差
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/2/ROOT/AAA
Process ID: 9860
Exception: System.AggregateException
Message: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.
StackTrace: at System.Threading.Tasks.TaskExceptionHolder.Finalize()
InnerException: System.Web.HttpException
Message: The remote host closed the connection. The error code is 0x800704CD.
StackTrace: at System.Web.Http.WebHost.HttpControllerHandler.EndProcessRequest(IAsyncResult result)
at System.Web.Http.WebHost.HttpControllerHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
请问您可以添加一些代码吗? –
也尝试使用TaskContinuationOptions.OnlyOnFaulted()方法,看看会发生什么 –
你的错误是自我解释。它不是真正的问题,但是你的代码会抛出异常 – YavgenyP