This topic has not yet been rated - Rate this topic

State Property

IIS 7.0

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

Namespace:  Microsoft.Web.Administration
Assembly:  Microsoft.Web.Administration (in Microsoft.Web.Administration.dll)
public ObjectState State { get; }

Property Value

Type: Microsoft.Web.Administration..::..ObjectState
One of the ObjectState values.

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.

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();
}


Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.