ASP.NET 4.0 Web App抛出"不正确的函数.(HRESULT异常:0x80070001)"

use*_*816 8 asp.net exception comexception iis-7.5

该应用程序是在运行Windows Server 2008 R2的计算机上的IIS 7.5中托管的ASP .NET 4.0中编写的.应用程序池使用集成管理Pipline模式.

当在几个没有任何明显共同点的不同页面上抛出以下异常.我自己无法重现异常,但上周在生产环境中发生了10次.

从堆栈跟踪我看到方法"HttpRequest.GetEntireRawContent"引发的异常,所以我想知道请求是否有问题,例如它太长或包含无效字符.

为了清楚起见,这个异常不会从我编写的代码中抛出,而是来自System.Web命名空间.所以我无法添加尝试...抓住它.

我会很高兴有关异常原因的任何想法或故障排除步骤以找到更多信息.

    Exception: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> 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)
    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.FillInFormCollection()
    at System.Web.HttpRequest.get_Form()
    at System.Web.HttpRequest.get_HasForm()
    at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
    at System.Web.UI.Page.DeterminePostBackMode()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.HandleError(Exception e)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at ASP.report_openinghours_aspx.ProcessRequest(HttpContext context)
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Run Code Online (Sandbox Code Playgroud)

编辑:

正如lukiffer所指出的,这里有一个类似的问题:stackoverflow.com/questions/7825127/建议修复是关闭TCP卸载,我理解的方式是TCP卸载使网络服务器免受TCP的许多复杂性的影响.因此,将其关闭将消耗大量的CPU周期,从而减慢Web服务器的速度,这显然是不可取的.

我也不明白为什么TCP卸载会导致IIS抛出异常.

usi*_*oob 0

您不可能仍然遇到此问题,但如果其他人遇到此问题,这里的链接可能会有所帮助。

TechNet 论坛

NIC 驱动程序的 TCP 任务卸载选项应在物理 NIC 级别(外部虚拟网络正在使用的主机的 NIC)设置。确保您没有禁用烟囱并认为您正在禁用任务卸载。在驱动程序的设置中,有一些名称中带有“卸载”的选项 - 这些是要关闭的选项。

  • 禁用物理网卡上的电源管理(某些驱动程序会打开此功能)。

  • 尝试使用物理 Intel NIC(Hyper-V 中问题最少的)

  • 检查VM中的IC是否与主机相同。

  • 检查 VM 是否存在其他问题,例如 CPU 或磁盘 IO 资源激增或任何其他可能导致挂起的问题。