共用方式為


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秒。 此逾時僅適用於元素中的 <compilation> 除錯屬性設定為 false

若逾時結束,則會提出例外。 你可以將相關資訊記錄在事件日誌的應用程式資料夾中。 你可以透過在設定元素中啟用應用程式健康監控 <healthMonitoring> 來達成這個目標。

適用於