System.Runtime.InteropServices.COMException Incorr

2020-02-11 01:21发布

问题:

I have an Asynchronus IHttpHandler in ASP.net and I am seeing this exception error in my ELMAH capture.

Windows Server 2008 R2 Web Edition IIS 7.5 ASP.NET .NET 4.0 Runtime Running HTTP on the site.

Could anyone shed some light on this one? Google lists some results from 2008 or so regarding a bug in .NET 2.0 about HTTP disconnecting during the Read() function of the request body.

Stack Trace

System.Web.HttpException (0x80004005): An error occurred while communicating with the remote host. The error code is 0x80070001. ---> System.Runtime.InteropServices.COMException (0x80070001): Incorrect function. (Exception from HRESULT: 0x80070001)

Server stack trace: 
    at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
    at System.Web.Hosting.IIS7WorkerRequest.ReadEntityCoreSync(Byte[] buffer, Int32 offset, Int32 size)
    at System.Web.HttpRequest.GetEntireRawContent()
    at System.Web.HttpRequest.get_InputStream()
    at MyHandler.ProcessRequest(HttpContext context)
    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
    at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
    at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

回答1:

This is an error reported by underlying unmanaged layers of IIS7 (webengine.dll). After some googling, the most relevant thread seems to indicate this is an error due to the network card driver configuration (TCP Offloading).

See this: An error occurred while communicating with the remote host. The error code is 0x80070001