我正在使用 (C#) 和 (ASP.NET Web API) 和 MS SQL 2008 R2 开发 Web 应用程序,并在 Windows Server 2008 的 IIS7 上托管,所有 API 都以 JSON 格式返回数据
当我从任何 Web 浏览器调用任何 API 并在第一次调用完成之前刷新页面以再次调用时,它会在事件查看器中给我警告,并且在 0 到 5 分钟后,II7 中的工作进程停止了大约 2 分钟(挂起)和在这 2 分钟内来自所有用户的所有 API 调用都不起作用,事件查看器给我一个错误:
事件查看器中的警告
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)