简体   繁体   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

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.

相关问题 ASP.NET MVC 在进行聚合时抛出错误 - 任何人都可以帮助我吗? - ASP.NET MVC is throwing an error while doing aggregation - can anyone help me? 如果由于在ASP.NET MVC 4应用程序的应用程序池中设置的空闲超时而导致应用程序超时,我们如何警告用户 - How can we warn the user if the application timeouts due to Idle-timeout set in the application pool of an ASP.NET MVC 4 app 种子方法中的类似代码,第一个起作用,第二个不起作用。 ASP.NET MVC向用户添加角色。 谁能帮我这个? - Similar code in seed method, first works, second not. ASP.NET MVC adding role to user. Can anyone help me with this? ASP.NET:即使将Visible设置为True,UpdatePanel也不会显示 - ASP.NET: UpdatePanel not displaying even when Visible set to True 如果autopostback = true,则Formview插入不起作用。 asp.net - Formview insert not working if autopostback=true. asp.net 谁能告诉我如何将物理文件保存到配置提供的路径 - ASP.NET Core MVC - Can Anyone Show Me How to Save Physical Files to a Path Provided by Configuration - ASP.NET Core MVC 防止ASP.NET MVC中的会话超时 - Preventing Session Timeouts in asp.net mvc 如何将复选框布尔值转换为字符串,有人可以帮助我ASP.NET MVC吗? - How to convert value from checkbox bool to string can someone help me ASP.NET MVC? 在生产应用程序中使用ASP.NET MVC 2 Preview 1是否可行? - Is it viable to use ASP.NET MVC 2 Preview 1 in a production application? 调试asp.net mvc应用程序时,“此模块的调试信息中缺少源信息” - “Source information is missing from the debug information for this module” when debugging asp.net mvc application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM