HttpRuntimeSection.ExecutionTimeout 属性
定义
获取或设置请求的允许执行时间。Gets or sets the allowed execution time for the request.
public:
property TimeSpan ExecutionTimeout { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsConverter))]
[System.Configuration.ConfigurationProperty("executionTimeout", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
[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=Mono.Cecil.CustomAttributeArgument)>]
[<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 值,指示请求的允许执行时间。A TimeSpan value that indicates the allowed execution time for the request.
- 属性
例外
请求执行时间超过了执行超时值设置的限制值。The request execution time exceeded the limit set by the execution time-out.
示例
下面的示例演示如何使用 ExecutionTimeout 属性。The following example shows how to use the ExecutionTimeout property.
// 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 自动关闭前允许执行请求的最大秒数。The ExecutionTimeout property indicates the maximum number of seconds a request is allowed to execute before being automatically shut down by ASP.NET. 默认值为110秒。The default is 110 seconds. 仅当元素中的 debug 特性设置为时,此超时才适用 <compilation> false 。This time-out applies only if the debug attribute in the <compilation> element is set to false.
如果超时过期,则会引发异常。If the time-out expires an exception is raised. 您可以在事件日志的应用程序文件夹中记录相关信息。You can record the related information in the Application folder of the Event Log. 为此,请在配置元素中启用应用程序运行状况监视 <healthMonitoring> 。You do this by enabling the application health monitoring in the <healthMonitoring> configuration element.