Nuno Quintas
Nuno Quintas

Reputation: 21

Vb.NET 2.0 My.settings not working properly

Well I don't even know where to begin describing this.

I have a project, that uses settings, for some paths, settings that I retrieve with the My.Settings. function.

In my laptop, when I change the .exe.config file, the settings are updated accordingly, but when I try that on the production server, it just shows the default value used while compiling.

I tried changing the solution configurations to debug and other custom configs with no effect. Tried to use the same folder copied and pasted without version control, still the same result. Tried a co-workers laptop, by using the last svn revision, it works there too. But on neither of the servers works.

.net 2.0 using VB.

What am I missing here..?

And yes, I am running the admin account on both servers.

Upvotes: 2

Views: 2136

Answers (2)

Steve
Steve

Reputation: 5545

I had the same issue; after running it the first time, the changes I made to the file had no effect. I searched my HD for the name of the EXE and found a folder under the Local\Roaming folder with the name of my EXE. Looking into that folder I could see the old config file.

I deleted the whole folder and the next time I ran the EXE, ta-da, it worked. Hope this helps someone in the future.

Upvotes: 1

Bradley Uffner
Bradley Uffner

Reputation: 16991

.exe.config just holds the default values I believe. Once you store custom values and save the settings from within the program the settings are stored in your profile directory.

This is usually located in %appdata%\CompanyName\RandomLookingNameWithExeFileNameInItSomeplace

Keep in mind it will be in the AppDataFolder of the user the application is running as,. not necessarily the user you are currently logged in as.

Upvotes: 1

Related Questions