首页 文章

如何防止ASP.NET 4.5中的长时间运行请求超时

提问于
浏览
3

Never mind that its not a best practice but for a custom requirement (there will only be a couple of users for the app & no concurrent access) ,我需要设置一个非常大的执行超时值,以便请求可能需要几个小时才能完成 . 在Web.config文件中,我将httpRuntime元素的executionTimeout attribute(定义允许请求在被ASP.NET自动关闭之前执行的秒数)设置为3000(8小时)

我已将编译元素中的debug属性设置为False,因为它是设置大超时值的前提条件 .

Web应用程序在ASP.NET 4.5和IIS 8.5 / Windows Server 2012上运行 .

即使我为executionTimeout属性设置了这么高的值,页面请求也会在1小时后超时 . 如何让页面不要超时?

executeTimeout是否有一个最大值,超过该值就无法增加? IIS或Windows Server 2012中的某些系统设置值是否强制web.config中的executionTimeout值生效?

1 回答

  • 0

    不知道为什么它不适合你 . 但我们已尝试设置以下适用于我们的值 .

    <httpRuntime maxRequestLength="2147483647" requestValidationMode="2.0" executionTimeout="4800" maxQueryStringLength="2097151" />
    

    随着

    <compilation debug="false" targetFramework="4.5">
    

相关问题