I have a C# application that uses several user settings to store its data. When I increase the version number of my application, those settings are lost and reset to their default values.
That's why I implemented the following code
if (Settings.Default.UpgradeRequired)
{
Settings.Default.Upgrade();
Settings.Default.UpgradeRequired = false;
Settings.Default.Save();
}
as suggested here.
The problem is: the call to Upgrade() does nothing. It does not throw an exception, but it does not load any of the old settings either. Every setting still has its default value afterwards. Also my new application version stores its settings in a new folder, right next to the old settings' folder.
Am I holding it wrong? ;-)
PS: I checked that an old set of settings is stored on the disk with reasonable values. So there should be definately something to work with for Upgrade().