Reputation: 603
I apologize this is going to be long winded. But I feel an understand of what I've done will better help some answer my question.
I've been working on adding application and user settings to a project I've been putting together. Well actually I've completed the task, written a file switch validation class that updates the user settings or resets them per the appropriate file switches and fires events for invalid, duplicate, or valid switches.
All of that is working great.
When it comes to my coding I have always had this learning disability where I need to understand exactly how something works before I can feel comfortable using it. I love all the stuff that Visual Studio does for me but I can't resist looking in the black box when I can.
That being said I started out using a .settings file added the settings i needed wired everything up everything tested like i expected. It of course generated the cs files and the app.config file perfect.
I didn't really like that since the designer file is not from a T4 code generation tool so I could not control that the static instance of the wrapper class is .Default (I just didn't like the way it reads in my code)....
So I ripped the entire class out of the designer file added it to my own cs file, made the modifications I wanted and deleted the cs and designer files and the .settings files. Ran things still working solid.
Then to make sure it was picking things up properly I added an additional setting to the class with all the proper attributes etc and sure enough it showed up in my code and worked just fine. I could reset, save etc just like those settings that had been generated from the original .settings file.
However...
I noticed that the app.config did not reflect the new value, nor did it seem to reflect the changes of the original user settings in my testing.
Now it's possible that I'm completely missing something but...
I can snag JUST the executable run it see the default settings. Then Run it with various user setting modifier switches see the appropriate settings. Run it again without the switches and see the same user settings yet there is no app.config or any other file generated in the directory with the executable. Nothing was made an embedded resource either by the way.
So finally to my question:
I'm wondering where in the heck are these values being persisted?
Upvotes: 1
Views: 276
Reputation:
Check local appdata directory (C:\Documents and Settings\USERNAME\Local Settings\Application data\YOURPROJECTNAME\YOURASSEMBLY\ASSEMBLYVERSION\YOURFILE.config
). Also consult MSDN, especially Settings File Locations
paragraph in Settings Persistence
section.
Upvotes: 1