nsteele84
asked on
User Settings not saving because of update code vb.net
Hi
I have a few user settings in my vb.net project. The problem I am having is that they are not updating when I save them. The settings are set in user in the project properties. My code is:
My.Settings.ServerIPAddres s = txtServerAddress.Text
My.Settings.ServerUserName = txtServerUser.Text
My.Settings.ServerPassword = EncodeServerData(txtServer Password.T ext)
My.Settings.Save()
The problem is in the following:
If My.Settings.UpdateSettings = True Then
My.Settings.Upgrade()
My.Settings.Save()
End If
I use this so that when a new version is installed I get the old settings. I need the best of both worlds the user to be able to change the settings and them being preserved when new versions are installed.
Any help would be appreciated
Nick
I have a few user settings in my vb.net project. The problem I am having is that they are not updating when I save them. The settings are set in user in the project properties. My code is:
My.Settings.ServerIPAddres
My.Settings.ServerUserName
My.Settings.ServerPassword
My.Settings.Save()
The problem is in the following:
If My.Settings.UpdateSettings
My.Settings.Upgrade()
My.Settings.Save()
End If
I use this so that when a new version is installed I get the old settings. I need the best of both worlds the user to be able to change the settings and them being preserved when new versions are installed.
Any help would be appreciated
Nick
ASKER
They are being changed programmatically by the end user.
I think when you deploy new version, you deploy the settings as well and they are overwriting even before the first execution of your app to perform upgrade? or you are taking care of the upgrade before the update process?
ASKER
This is not happening when I install a new version it is happening during normal operations. Settings are being saved program closed then when reopened previous settings are there not new ones
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you changing User Settings in Visual Studio? or you are changing them programmatically?
Regards,
Chinmay.