HttpRuntimeSection.ExecutionTimeout HttpRuntimeSection.ExecutionTimeout HttpRuntimeSection.ExecutionTimeout HttpRuntimeSection.ExecutionTimeout Property

定義

取得或設定要求所允許的執行時間。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; }
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. 只有當<compilation>元素中的 debug 屬性設定為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> configuration 元素中啟用應用程式健康情況監視。You do this by enabling the application health monitoring in the <healthMonitoring> configuration element.

適用於