System.Configuration.IApplicationSettingsProvider.Upgrade Method

Indicates to the provider that the application has been upgraded. This offers the provider an opportunity to upgrade its stored settings as appropriate.

Syntax

public void Upgrade (SettingsContext context, SettingsPropertyCollection properties)

Parameters

context
A System.Configuration.SettingsContext describing the current application usage.
properties
A System.Configuration.SettingsPropertyCollection containing the settings property group whose values are to be retrieved.

Remarks

The .NET Framework enables side-by-side installation and execution of different versions of the same application. The application settings provider stores the application settings for each version of an application separately to ensure isolation. However, you may want to migrate settings from the previous version of an application to the current one. To provide this migration functionality, use the IApplicationSettingsProvider.Upgrade(SettingsContext, SettingsPropertyCollection) method, implemented in a class derived from System.Configuration.SettingsProvider.

You can use the IApplicationSettingsProvider.Upgrade(SettingsContext, SettingsPropertyCollection) method in conjunction with the IApplicationSettingsProvider.GetPreviousVersion(SettingsContext, SettingsProperty) method to migrate application settings during or after the installation of a new version of an application.

This method should be suppressed for every application setting that has the System.Configuration.NoSettingsVersionUpgradeAttribute is applied to it, or to the entire settings wrapper class, derived from System.Configuration.ApplicationSettingsBase.

Requirements

Namespace: System.Configuration
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0