简体   繁体   English

增加ASP.NET应用程序的应用程序超时

[英]Increasing application timeout for asp.net application

In my application, I make A service call which may take upto 2 mins To return value. 在我的应用程序中,我进行了一次服务调用,最多可能需要2分钟才能返回值。 (process Take Place across multiple databases). (过程跨多个数据库进行)。

Upon calling this method the application times out. 调用此方法后,应用程序超时。

I have set the following in web config. 我已经在网络配置中设置了以下内容。 still i am getting the error when hosted in IIS 仍然在IIS中托管时出现错误

<system.web>
    <compilation debug="true" targetFramework="4.0" />
    <sessionState timeout="40"></sessionState>
    <httpRuntime maxRequestLength="2147483647" executionTimeout="3600"/>

</system.web>

I have set the same execution timeout in service web.config as well please help me in increasing the time out for the application. 我还在服务web.config中设置了相同的执行超时,请帮助我增加应用程序的超时时间。

Have you tried setting the shutdownTimeout value in the httpRuntime section? 您是否尝试过在httpRuntime部分中设置shutdownTimeout值? The default shutdown time of an idle application is 90 seconds. 空闲应用程序的默认关闭时间为90秒。

<httpRuntime maxRequestLength="2147483647" shutdownTimeout="360" executionTimeout="3600"/>

MSDN Reference: HttpRuntimeSection.ShutdownTimeout Property MSDN参考: HttpRuntimeSection.ShutdownTimeout属性

<compilation debug="false" targetFramework="4.0" />

Set debug="false" should solve the problem. 设置debug =“ false”应该可以解决问题。

From MSDN : MSDN

Execution Timeout: Optional Int32 attribute. 执行超时:可选的Int32属性。 Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET. 指定在ASP.NET自动关闭请求之前允许执行该请求的最大秒数。 This time-out applies only if the debug attribute in the compilation element is False. 仅当编译元素中的debug属性为False时,此超时才适用。 Therefore, if the debug attribute is True, you do not have to set this attribute to a large value in order to avoid application shutdown while you are debugging. 因此,如果debug属性为True,则不必将此属性设置为较大的值,以避免在调试时关闭应用程序。 The default is 110 seconds. 默认值为110秒。 Note: In the .NET Framework 1.0 and 1.1, the default is 90 seconds. 注意:在.NET Framework 1.0和1.1中,默认值为90秒。

<asp:ScriptManager ID="Scriptmanager1" runat="server" AsyncPostBackTimeout="1200" />

the callback to update the browser for the client has a default timeout (90 seconds) in the script manager. 用于更新客户端浏览器的回调在脚本管理器中具有默认超时(90秒)。 so if your code behind is running the full page but the browser does not update, then this tag might help. 因此,如果后面的代码正在运行整个页面,但浏览器没有更新,则此标记可能会有所帮助。

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

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