Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User.Settings file reverts values upon ClickOnce Update

I have read the numerous questions here on this and even posted one of my own trying to get to the bottom of this(My Previous Question). Unfortunately, none of them answer my question. My .Settings file get's reset whenever I deploy an update through ClickOnce. I thought ClickOnce was supposed to handle this sort of thing for me but since it seems no, I implemented the .Upgrade() with a Settings Flag like so:

if (Settings.Default.MustUpgradeSettings)
        {
            Settings.Default.Upgrade();
            Settings.Default.MustUpgradeSettings = false;
            Settings.Default.Save();
        }

Which I check OnLoad(). Am I missing something? This is seriously driving me nuts!


I have also posted this at MSDN, HERE, and they are even less help then SO so far. I just know that I will end up with "egg and my face in alignment" when this is all over I just wish someone could point that out for me...

like image 910
Refracted Paladin Avatar asked Nov 26 '22 09:11

Refracted Paladin


1 Answers

I believe it's supposed to do that, at least from what I'm reading here.

http://msdn.microsoft.com/en-us/library/ms228995.aspx

Just as each version of a ClickOnce application is isolated from all other versions, the application settings for a ClickOnce application are isolated from the settings for other versions as well. When your user upgrades to a later version of your application, application settings compares most recent (highest-numbered) version's settings against the settings supplied with the updated version and merges the settings into a new set of settings files.

like image 172
Nikki9696 Avatar answered Nov 27 '22 21:11

Nikki9696