Keeping settings between Clickonce updates
Hi
I am using ClickOnce deployment and application settings.
I am developing a small pice of software for my friends and using click once to update it, but after every upddate the app loses its user settings (my.settings)
How can I persist them through updates?
im sure im missing somthing simple.
Thanks
Simmy
[331 byte] By [
simmy] at [2008-2-4]
Hi Simmy,
Unfortunately, user settings are placed in a path partially determined by the assembly's identity. When you update your assembly, you'll end up with a different path.
However, there is a way for you to code what you want by hand. ClickOnce has a concept of an application data directory, in which files can be placed that are migrated across versions. If you place a file in the data directory (by choosing it's build type as Content), then it will always be moved up when you update your application.
Also, IsolatedStorage will also be moved up with each version of your ClickOnce application. So you could simply create an Application scoped IsolatedStorage stream, and store your settings there.
Unfortunatley neither of these will help you get your settings via My.Settings -- you'll have to parse the file that you pull out yourself 
Hopefully that helps to point you in a direction that will work for your application's settings.
-Shawn
The settings get upgraded for you automatically in Clickonce deployed applications when you install a new version. However, there was a bug in Beta 2 of .NET 2.0 that prevented this from working right. This should work fine in a recent CTP drop and definitely in the final release.
For more on settings and upgrade, see this FAQ that I posted sometime back:
http://blogs.msdn.com/rprabhu/articles/433979.aspx
Sorry I am also following this issue and wondering about the same. In the blog listed it says to call
Properties.
Settings.Default.Upgrade();Is this to replace the settings just installed by click once with the pervious version saved on the users machine, or are you saying its not possible to do this with app.config file?
Thanks In Advance
Martin