Settings Reverting

Brady Kelly <[email protected]> Thu, 24 Apr 2008 10:24:54 +0200
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
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