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> 來執行此動作。

適用於