[英]asp.net mvc application timeouts in production even when debug is set to true. Can anyone help me on this
We have an ASP.Net MVC application. 我们有一个ASP.Net MVC应用程序。 It has been published in the Production environment and debug is set to true (not sure why) in WEb.config.
它已在生产环境中发布,并且在WEb.config中将debug设置为true(不确定原因)。
compilation batch="true" debug="true" targetFramework="4.5"
But still the application timeouts. 但是应用程序仍然超时。
I want to make debug="false"
and add the below tag. 我想使
debug="false"
并添加以下标签。
httpRuntime executionTimeout="43200" maxRequestLength="104856" targetFramework="4.5"
But if the application timeouts when debug="true"
then I think it will timeout even when debug="false"
irrespective of the executionTimeout. 但是,如果当
debug="true"
时应用程序超时,那么我认为即使debug="false"
时它也将超时,而与执行超时无关。
Is there any way we can set the timeout via Global.asax.cs? 有什么办法可以通过Global.asax.cs设置超时时间?
Edit 1: The application gets a timeout if the process runs for more that 2 minutes. 编辑1:如果进程运行超过2分钟,则应用程序将超时。
So that means the session is still alive. 因此,这意味着该会话仍然有效。
<sessionState mode="InProc" cookieless="false" timeout="60" />
For the database I have added command timeout of 5 minutes (just for testing purpose) but still there is a timeout. 对于数据库,我添加了5分钟的命令超时(仅出于测试目的),但是仍然存在超时。
Edit 2: After browsing through the logs this was the error. 编辑2:浏览日志后,这是错误。
The remote host closed the connection. The error code is 0x800703E3
User session might be ending, which might make everything else irrelevant: 用户会话可能即将结束,这可能会使其他所有内容都不相关:
Set this in IIS: sessionState timeout="120" 在IIS中进行设置:sessionState timeout =“ 120”
Or Web.config: 或Web.config:
<configuration>
<system.web>
<sessionState mode="InProc" timeout="120"></sessionState>
</system.web>
</configuration>
Default is 20 minutes, so your 12 hour httpruntime executiontimeout would be irrelevant. 默认值为20分钟,因此12小时的httpruntime执行超时将是无关紧要的。
Make sure you have adequate connection timeout for initial database connection AND command timeout for your database if you have long running scripts. 如果您的脚本运行时间较长,请确保具有足够的连接超时时间来进行初始数据库连接,并确保数据库具有命令超时时间。 Check logs and load a page with no database dependency as a test.
检查日志并加载没有数据库依赖性的页面作为测试。
Also, Microsoft documentation states: 此外,Microsoft文档指出:
“This time-out applies only if the debug attribute in the element is set to false.” “仅当元素中的debug属性设置为false时,此超时才适用。”
https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.httpruntimesection.executiontimeout?view=netframework-4.7.2 https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.httpruntimesection.executiontimeout?view=netframework-4.7.2
So, with debug currently set to true, the executiontimeout setting will not do anything until debug is changed to false. 因此,在debug当前设置为true的情况下,executetimeout设置将不执行任何操作,直到debug更改为false。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.