The Kinetic Jump site navigation header requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

Welcome Guest Search | Active Topics | Log In | Register

AppLife Update and .Net ApplicationSettings Options
brianh
#1 Posted : Wednesday, October 15, 2008 7:59:07 AM
Rank: Administration
Groups: Member, Administration

Joined: 5/24/2007
Posts: 362
Location: Minnesota

When using the built-in .Net application settings infrastructure, the user settings are lost when the primary assembly version number is upgraded if you dont explicitly upgrade the settings.  Thankfully, the .Net framework has taken care of the details.

 

Basically, this is what you need to do:

1.       Add a Setting to your application called UpgradeSettings and set it’s default value to true.


2.       On startup, or when you check for updates, look at this setting.  If it is true (it will be false if you have lost your settings due to an update), then call the Upgrade() method.


3.       Set the UpgradeSettings setting to false.  This will prevent startups from calling Upgrade until the next time it is needed.


4.       Save your settings.

 

Example:


Sub UpgradeMySetings() 

        If My.Settings.UpgradeSettings Then 

                My.Settings.Upgrade() 

                My.Settings.UpgradeSettings = False 

                My.Settings.Save() 

        End If 

End Sub 



And here is Microsoft Documentation on the relevant method.

 

msdn content

Brian Haas
Kinetic Jump Software
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.