views:

79

answers:

1

My deployment of upgrades to an application written in C# (.NET 3.0) consist of simply replacing an older .exe with the new one. Because that older version can currently be used by some customers, I simply rename the old version to blahblah.exe.old and copy the new one to the same folder. When the user opens up the application again, the new one loads up.

The problem is, every time I deploy a new version, the user scope settings are always reverted back to the default values. Any help would greatly be appreciated.

Thanks

+1  A: 

Possible duplicate: Settings.Settings file keeps getting reset

My answer from that question applies here:

I believe Settings.settings files are saved based on the current version number, basically as a "feature" where settings are not saved between differing versions of the same program on a machine. Assuming you're incrementing the version number automatically when compiling (1.0.* in AssemblyInfo.cs), you'll be resetting your settings everytime you compile a new version.

To correct this, the best course would be to serialize your own settings file to the Application Data directory.

Also note the other post in the answer, stating Properties.Settings.Value.Upgrade(); can be called to upgrade your settings from the previous version.

Will Eddins