繁体   English   中英

即使将debug设置为true,asp.net mvc应用程序在生产中也会超时。 谁可以帮我这个事

[英]asp.net mvc application timeouts in production even when debug is set to true. Can anyone help me on this

我们有一个ASP.Net MVC应用程序。 它已在生产环境中发布,并且在WEb.config中将debug设置为true(不确定原因)。

compilation batch="true" debug="true" targetFramework="4.5"

但是应用程序仍然超时。

我想使debug="false"并添加以下标签。

httpRuntime executionTimeout="43200" maxRequestLength="104856" targetFramework="4.5"

但是,如果当debug="true"时应用程序超时,那么我认为即使debug="false"时它也将超时,而与执行超时无关。

有什么办法可以通过Global.asax.cs设置超时时间?

编辑1:如果进程运行超过2分钟,则应用程序将超时。

因此,这意味着该会话仍然有效。

<sessionState mode="InProc" cookieless="false" timeout="60" />

对于数据库,我添加了5分钟的命令超时(仅出于测试目的),但是仍然存在超时。

编辑2:浏览日志后,这是错误。

The remote host closed the connection. The error code is 0x800703E3

用户会话可能即将结束,这可能会使其他所有内容都不相关:

在IIS中进行设置:sessionState timeout =“ 120”

或Web.config:

<configuration>
<system.web>
<sessionState mode="InProc" timeout="120"></sessionState>
</system.web>
</configuration>

默认值为20分钟,因此12小时的httpruntime执行超时将是无关紧要的。

如果您的脚本运行时间较长,请确保具有足够的连接超时时间来进行初始数据库连接,并确保数据库具有命令超时时间。 检查日志并加载没有数据库依赖性的页面作为测试。

此外,Microsoft文档指出:

“仅当元素中的debug属性设置为false时,此超时才适用。”

https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.httpruntimesection.executiontimeout?view=netframework-4.7.2

因此,在debug当前设置为true的情况下,executetimeout设置将不执行任何操作,直到debug更改为false。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM