How to persist changes in a .settings/.config file across a file version change?

Posted by CuriousCoder on Stack Overflow See other posts from Stack Overflow or by CuriousCoder
Published on 2010-03-19T13:23:31Z Indexed on 2010/03/20 9:51 UTC
Read the original article Hit count: 489

Filed under:
|
|

I have created an application that uses settings.settings to store some user specific settings (scope=User). Settings are loaded correctly on startup, changed during use and saved correctly for next launch. This cycle appears to have no problems.

The problem arises when I update the assembly and file versions for a new build. The settings are no longer loaded on startup (instead the default values are used). It also appears that a config file saved from version 1.1 will persist even if version 1.2 is launched and a NEW config file is generated and saved too (i.e. you can relaunch version 1.1 and the config file will be the config file that was saved from that version).

So it appears that the settings are specific to the version of the assembly and/or file. It is also worth noting that between version 1.1 and version 1.2 there were no changes to the settings.settings file or anything else for that matter (i.e. the only change I made between these different builds was modifying the version numbers).

Is there a way to persist these settings across version changes?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET