Share via


ApplicationPool.State Property

Definition

Gets the run-time state of the current application pool.

public:
 property Microsoft::Web::Administration::ObjectState State { Microsoft::Web::Administration::ObjectState get(); };
public Microsoft.Web.Administration.ObjectState State { get; }
member this.State : Microsoft.Web.Administration.ObjectState
Public ReadOnly Property State As ObjectState

Property Value

One of the ObjectState values.

Examples

The following example checks the value of the State property. If the application pool is stopped, the example starts it. This code example is part of a larger example provided for the ApplicationPool class.

// If the applicationPool is stopped, restart it.
if (applicationPool.State == ObjectState.Stopped)
{
    applicationPool.Start();
}

Remarks

Valid values are Starting, Started, Stopping, Stopped, and Unknown.

You can modify the value of the State property in the Actions pane of IIS Manager when the application pool is selected.

Applies to