.NET Framework Class Library
HostingEnvironmentSection..::.ShutdownTimeout Property

Gets or sets the amount of time, in seconds, to gracefully shut down the application.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)
Syntax

Visual Basic (Declaration)
<TimeSpanValidatorAttribute(MinValueString := "00:00:00", MaxValueString := "10675199.02:48:05.4775807")> _
<ConfigurationPropertyAttribute("shutdownTimeout", DefaultValue := "00:00:30")> _
<TypeConverterAttribute(GetType(TimeSpanSecondsConverter))> _
Public Property ShutdownTimeout As TimeSpan
Visual Basic (Usage)
Dim instance As HostingEnvironmentSection
Dim value As TimeSpan

value = instance.ShutdownTimeout

instance.ShutdownTimeout = value
C#
[TimeSpanValidatorAttribute(MinValueString = "00:00:00", MaxValueString = "10675199.02:48:05.4775807")]
[ConfigurationPropertyAttribute("shutdownTimeout", DefaultValue = "00:00:30")]
[TypeConverterAttribute(typeof(TimeSpanSecondsConverter))]
public TimeSpan ShutdownTimeout { get; set; }
Visual C++
[TimeSpanValidatorAttribute(MinValueString = L"00:00:00", MaxValueString = L"10675199.02:48:05.4775807")]
[ConfigurationPropertyAttribute(L"shutdownTimeout", DefaultValue = L"00:00:30")]
[TypeConverterAttribute(typeof(TimeSpanSecondsConverter))]
public:
property TimeSpan ShutdownTimeout {
    TimeSpan get ();
    void set (TimeSpan value);
}
JScript
public function get ShutdownTimeout () : TimeSpan
public function set ShutdownTimeout (value : TimeSpan)

Property Value

Type: System..::.TimeSpan
A TimeSpan that is the specified number of seconds to gracefully shut down the application. The default is 30 seconds.
Remarks

The default value for the ShutdownTimeout property is 30 seconds. This setting can be set at the machine or application level. If this setting is defined at any other configuration level, it is ignored. If a debugger is attached to the application, the application will not be shut down.

Examples

The following code example shows how to use the ShutdownTimeout property. This code example is part of a larger example provided for the HostingEnvironmentSection class.

Visual Basic
' Display the ShutdownTimeout property
Console.WriteLine("Shutdown Timeout: {0}", configSection.ShutdownTimeout)
C#
// Display ShutdownTimeout property
Console.WriteLine("Shutdown Timeout: {0}", configSection.ShutdownTimeout);
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0, 2.0
See Also

Reference

Tags :


Page view tracker