HttpRuntimeSection.ExecutionTimeout 属性

定义

获取或设置请求的允许执行时间。

public:
 property TimeSpan ExecutionTimeout { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsConverter))]
[System.Configuration.ConfigurationProperty("executionTimeout", DefaultValue="00:01:50")]
[System.Configuration.TimeSpanValidator(MaxValueString="10675199.02:48:05.4775807", MinValueString="00:00:00")]
public TimeSpan ExecutionTimeout { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsConverter))>]
[<System.Configuration.ConfigurationProperty("executionTimeout", DefaultValue="00:01:50")>]
[<System.Configuration.TimeSpanValidator(MaxValueString="10675199.02:48:05.4775807", MinValueString="00:00:00")>]
member this.ExecutionTimeout : TimeSpan with get, set
Public Property ExecutionTimeout As TimeSpan

属性值

一个 TimeSpan 值,指示请求的允许执行时间。

属性

例外

请求执行时间超过了执行超时值设置的限制值。

示例

下面的示例演示如何使用 ExecutionTimeout 属性。

// Get the ExecutionTimeout property value.
Response.Write("ExecutionTimeout: " +
  configSection.ExecutionTimeout.ToString() + "<br>");

// Set the ExecutionTimeout property value to 2 minutes.
configSection.ExecutionTimeout = TimeSpan.FromMinutes(2);
' Get the ExecutionTimeout property value.
Response.Write("ExecutionTimeout: " & _
  configSection.ExecutionTimeout.ToString() & "<br>")

' Set the ExecutionTimeout property value to 2 minutes.
configSection.ExecutionTimeout = TimeSpan.FromMinutes(2)

注解

属性 ExecutionTimeout 指示请求在 ASP.NET 自动关闭之前允许执行的最大秒数。 默认值为 110 秒。 仅当 元素中的调试属性设置为 false时,<compilation>此超时才适用。

如果超时过期,则会引发异常。 可以在事件日志的 Application 文件夹中记录相关信息。 为此,可以在 配置元素中 <healthMonitoring> 启用应用程序运行状况监视。

适用于