Automatically "upgrade" user settings from previous version of app.config file?

Posted by SqlRyan on Stack Overflow See other posts from Stack Overflow or by SqlRyan
Published on 2009-07-29T05:33:01Z Indexed on 2012/10/17 11:01 UTC
Read the original article Hit count: 210

Every time I compile my app and the version number changes (I have an auto-incrementing build number), I lose the user-configured app.config settings, since they're stored in the AppData folder for a specific version. Essentially, every release of my application starts from scratch as far as user settings go.

While this is a mild annoyance in development, it raises the question as I approach deployment/release - if I use the app.config to store my user settings, will the user's personalized settings be hosed every time they install a patch that changes the version number of my app? If so, is there an easy way to "upgrade" the settings from the previous release? I know that using HKCU in the registry is another option, but I like the ease of the My.Settings namespace, and I'd like to stay with app.config.

Another SO question asks something similar, though the answer doesn't seem that clear. Will setting my MSI so it asks the user to upgrade be enough to preserve these user-level settings?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about vb.net