5

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...

Community
  • 1
  • 1
Refracted Paladin
  • 12,096
  • 33
  • 123
  • 233

2 Answers2

1

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.

Nikki9696
  • 6,260
  • 1
  • 28
  • 23
-1

FYI: Does not work for me either. Everything it should do, it does not (MustUpgradeSettings isn't detected as true, but regardless of that the Upgrade function does not work. GetPreviousSettings function returns defaults too. Don't understand why there are no other complaints about this

Possible solution is DIY

benscabbia
  • 17,592
  • 13
  • 51
  • 62