Discussion:
Settings Reverting
Brady Kelly
2008-04-24 08:24:54 UTC
Permalink
I have a small application that uses Properties.Settings to store connection
strings. My problem is that every now and again, the settings revert to
defaults. I haven't been able to narrow it down yet, but long ago, when
addressing this problem, I was advised to use the code below to prevent this
happening due to version numbers changing, I think, but it doesn't work all
the time, even without version numbers changing. I call UpgradeSettings
first in the Load event.



private void UpgradeSettings()

{

if (Properties.Settings.Default.CallUpgrade)

{

Properties.Settings.Default.Upgrade();

Properties.Settings.Default.CallUpgrade = false;

}

}


===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Loading...