Delete obsolete settings in My.Settings

gs99

Active member
Joined
May 8, 2010
Messages
42
Programming Experience
Beginner
VB 2010 Express.
When I display user.config, it shows old settings that I've deleted via Project, Properties, Settings.
I know the file is current,since it reflects changes made recently.

How can I delete the obsolete settings?


The Windows (7) path is C:\Users\myName\AppData\Local\appName\appName.vshost...\1.0.0.0\user.config
 
On the Settings page of the project properties there is a Synchronize button, which will delete all user config files and start again from the default values in the application config file.
 
On the Settings page of the project properties there is a Synchronize button, which will delete all user config files and start again from the default values in the application config file.
I clicked Synchronize button. Got message:
“No user.config files were found in any of the following locations: “
(No information is provided about the locations.)

I found this message on social.msdn.microsoft.com/Forums and the moderator suggested “Did you add the App.config in the project? Please try to add it from "Right click on the project" -> "Add Item..." -> "Add Application Configuration File"
Application Settings Won't Synchronize

My project already had App.config. However, when I open it, there are errors shown in Error List. And it doesn’t include all the settings in My.Settings.

The user in that post did My.Settings.Reset().
I did that, causing user.config to have these basic lines:

VB.NET:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
</configuration>

However, Project, Settings still showed my Settings. So there was still a "disconnect" between these two.

I manually deleted the settings I previously had added, then added them again (in Project, Settings).
After adding two of them, I checked user.config and it still showed no settings.

But at some point user.config changed because it now shows the correct data.
I don’t know if closing the project or restarting VB did that.

However, App.config still shows incorrect data and the errors also appear (only when I open the file).

I’ve solved my problem.
Some day perhaps I’ll understand the relationship of user.config, App.config, and what appears in Project Settings.
There seems to be a “disconnect” among these.

And the cryptic message in My.Settings Synchronize button:
Why does it not show the locations?
What is it supposed to synchronize?
 
Last edited:
Back
Top