ApplicationPool.Recycling Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets recycling settings for the current 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 that specifies recycling settings for the current application pool.
Examples
The following example checks the value of the Microsoft.Web.Administration.ApplicationPoolPeriodicRestart.Time property. If the property is set to a value greater than one day (1440 minutes), the example resets the value to 1440 minutes. This code example is part of a larger example provided for the ApplicationPool class.
// Set the recycling time to a maximum of one day (1440 minutes).
if (applicationPool.Recycling.PeriodicRestart.Time.TotalMinutes > 1440)
{
applicationPool.Recycling.PeriodicRestart.Time = TimeSpan.FromMinutes(1440);
}
Remarks
You can use the properties and methods of the object returned by this property to configure the recycling behavior of the current application pool. To set default values for all application pools on the server, use the ApplicationPoolDefaults object.
Note
The property values of the ApplicationPoolRecycling object will not be written to the ApplicationHost.config file until the Microsoft.Web.Administration.ServerManager.CommitChanges method is called.