Marlon Regenhardt Marlon Regenhardt - 1 year ago 95
C# Question

After changing Assembly(File)Version from to, settings get saved to a new folder, but loaded from the old one

So after much time trying online solutions and asking collegues, I finally found the reason my Settings.settings wouldn't safe the settings I configured in my program:

When I changed

from to (because it's the seconds Version of the program - I rewrote it in MVVM from an old version made years ago), it created a new folder to save the settings to - ...\AppData\local\MyProgram\MyProgram-{UID}\

The Problem is, it still loads the settings from the \ folder.

How can I make it fully commit to being Will this take long psychological sessions with my program, or can I just be straight forward somehow? I would really like my program to finally grow up to be a

Edit: More info

AssemblyInfo.cs last lines now:

[assembly: AssemblyVersion("")]
[assembly: AssemblyFileVersion("")]

After the upgrade, the second folder gets created and settings get saved to its user.settings, but still et loaded (Settings.Upgrade()) from the

Folders after AssemblyVersion upgrade

Answer Source

You need to call Settings.Upgrade() only once when you start the new version application otherwise you are continuously overwriting the settings from the old version.

You should add a flag in your user.config that you set when you call Upgrade().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download