Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to preserve user.config?

Status
Not open for further replies.

gdrenfrew

Programmer
Aug 1, 2002
227
GB
Hi all,

Am looking for a bit of advice on how best to preserve user.config settings each time we deploy our C# application.

Currently the app is deployed via an .Msi and requires the old versions be de-installed. The de-installation leaves previous user.config files in tact in the user's Document & Settings profile - which is fine. (This is done via Citrix)

The directory structure of the location of the user.config has a GUID in it - which I can control via giving the exe projects Strong Names (no strong name means a random guid in the path on each rebuild). This works fine.

I then call the Settings.Default.Update() method on startup which imports the previous version's user.config - as long as it is in the same directory path with the same guid (but different version number obviously).

Is this the best way to do it, or is there some setting in the Deployment Project I can change that will always find the most recent copy of the user.config?

(Giving the appropriate projects Strong Names means I have to reinstall some other supporting DLLs which isn't a massive problem, just I'd prefer to jump through as few hoops as possible :) ).


Thankyou all!
 
I also use MSI's in my install process... There are ways, if you're interested, in setting up the packages so you don't have to uninstall everytime... I know that can get annoying fast.... as far as the user.config goes... I use a batch file (within the package) to move my configs to a temporary directory at the very beginning of the install and then move it back at the very end of the install.

Hope this helps


Kevin Davie
Consultant
Sogeti USA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top