We help IT Professionals succeed at work.

My.Settings

1,027 Views
Last Modified: 2013-11-26
Hi guys

I wonder how My.settings work, if a user has made alot of settings for his application and I Install a new version what happands with the settings hon taht computer

I want to keep the settings even if I install a newer version, is that possible?
Comment
Watch Question

Dirk HaestProject manager
CERTIFIED EXPERT

Commented:
I guess if you don't install the settings-file (with your installer) and it refers to the same name of settings, it won't be changed on the pc of the user !

Author

Commented:
Can I chose that?
My.Settings is the default settings file in VS, so that has alwas the same name, or have i missed something?

Author

Commented:
I found this here on EE
http://cs.rthand.com/blogs/blog_with_righthand/archive/2005/12/09/246.aspx

But I can't get this code to work..
Dirk HaestProject manager
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
I added UpdateRequire  to settings, but i'm not shure about the code to that?

This dosen't work  

        If (My.Settings.Default.UpdateRequire) Then
            My.Settings.Default.Update()
            My.Settings.Default.UpdateRequired = False
        End If

Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.

Author

Commented:
VS want's this.. but I can't test it , anyone who knows what the correct method is..?

        If My.Settings.UpdateRequired Then
            My.MySettings.Default.Upgrade()
            My.Settings.UpdateRequired = False
        End If.
Senior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.