-
May 18th, 2024, 08:28 PM
#1
Thread Starter
Junior Member
Get data form existing user.config file
Hi all,
I have build an application/tool and there are some settings which can be changed. Saving to the user.config file works like a charm.
But...
When updating the application, a new folder in AppData\Local\<APP NAME> gets a new folder with a kind of hash in its name. And in that new folder a new user.config file is created. The settings in the new application should use the "old" folder so the user doesn't need to adjust the settings everytime I update the application.
How can I achieve that? I thought a "simple"
Code:
My.Settings.Upgrade()
would do the tric but apparently I must to more.
Thank you!
Paul
-
May 18th, 2024, 10:46 PM
#2
Re: Get data form existing user.config file
Thread moved from VB.NET to Application Deployemt.
-
May 18th, 2024, 10:50 PM
#3
Re: Get data form existing user.config file
What .NET version are you targeting? It may not make a difference but I want to test using the same version. I've never done this myself but it's my understanding that a call to Upgrade should do the trick but that you don't even need to call it yourself. If you add an Application-scoped setting named UpgradeRequired and set that to True each time you deploy a new version, I have read that that should trigger Upgrade to be called automatically. If you don't want to do that for some reason, please show us the actual context in which you're calling Upgrade.
-
May 19th, 2024, 06:11 PM
#4
Thread Starter
Junior Member
Re: Get data form existing user.config file
Target .NET version is 8.0.
Is the UpdateRequired something like this?
Code:
If Not Settings.IsUpgraded Then
Settings.Upgrade()
Settings.IsUpgraded = True
Settings.Save()
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|