Share via


ApplicationPoolDefaults.AutoStart Property

Definition

Gets or sets a value indicating whether the application pool is automatically started when IIS is started.

public:
 property bool AutoStart { bool get(); void set(bool value); };
public bool AutoStart { get; set; }
member this.AutoStart : bool with get, set
Public Property AutoStart As Boolean

Property Value

true if the application pool should start automatically; otherwise, false. The default is true.

Examples

The following example sets the AutoStart property and creates and commits a new application pool. This code example is part of a larger example provided for the ApplicationPoolDefaults class.

Console.WriteLine("AutoStart:\t{0}",
    manager.ApplicationPoolDefaults.AutoStart.ToString());
manager.ApplicationPoolDefaults.AutoStart = false;
manager.ApplicationPoolDefaults.Cpu.Limit = 26;
manager.ApplicationPoolDefaults.Recycling.PeriodicRestart.Time = TimeSpan.FromMinutes(1000);
// Create a new application pool.
ApplicationPoolCollection applicationPoolCollection = manager.ApplicationPools;
applicationPoolCollection.Add("new app pool");
// Commit the changes to ApplicationHost.config file.
manager.CommitChanges();

Remarks

A value of true indicates to the World Wide Web Publishing Service (WWW service) that the application pool should be automatically started when it is created or when IIS is started.

Applies to

See also