Link to home
Start Free TrialLog in
Avatar of nsteele84
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.ServerIPAddress = txtServerAddress.Text
        My.Settings.ServerUserName = txtServerUser.Text
        My.Settings.ServerPassword = EncodeServerData(txtServerPassword.Text)
        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
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Hi Nick,

Are you changing User Settings in Visual Studio? or you are changing them programmatically?

Regards,
Chinmay.
Avatar of nsteele84
nsteele84

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?
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
Avatar of nsteele84
nsteele84

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial