How to exchange settings between different versions of the same software

I am extracting from ApplicationSettingsBase to save our user settings, however, when the build number is increased, the application uses the new settings folder, so the old settings are lost. What is a suitable way to handle the situation with general settings on different lines.

+4
source share
1 answer

You have a custom parameter called Upgraded, boolean, which defaults to false. Then check:

if (!Properties.Settings.Default.Upgraded) { Properties.Settings.Default.Upgrade(); Properties.Settings.Default.Upgraded = true; Properties.Settings.Default.Save(); Trace.WriteLine("INFO: Settings upgraded from previous version"); } 

This will update the settings from the previous version if this is the first launch of a new version.

+7
source

All Articles