Share via


ApplicationPoolDefaults.Recycling Property

Definition

Gets recycling settings for the application pool.

public:
 property Microsoft::Web::Administration::ApplicationPoolRecycling ^ Recycling { Microsoft::Web::Administration::ApplicationPoolRecycling ^ get(); };
public Microsoft.Web.Administration.ApplicationPoolRecycling Recycling { get; }
member this.Recycling : Microsoft.Web.Administration.ApplicationPoolRecycling
Public ReadOnly Property Recycling As ApplicationPoolRecycling

Property Value

An ApplicationPoolRecycling object.

Examples

The following example displays the values of the <xref:System.ApplicationHost.Configuration.PeriodicRestartSettings.Memory%2A> and <xref:System.ApplicationHost.Configuration.PeriodicRestartSettings.Time%2A> properties. The <xref:System.ApplicationHost.Configuration.PeriodicRestartSettings.Time%2A> property is set to a specific value and committed. This code example is part of a larger example provided for the ApplicationPoolDefaults class.

Console.WriteLine("PeriodicRestart.Memory:\t{0}",
    manager.ApplicationPoolDefaults.Recycling.PeriodicRestart.Memory.ToString());
Console.WriteLine("   Time:\t\t\t{0}",
    manager.ApplicationPoolDefaults.Recycling.PeriodicRestart.Time.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

You can use the properties and methods of the object returned by the Recycling property to configure the recycling behavior of a new application pool.

Applies to

See also