I am using Visual C# built in feature Settings to save some of my program's options. It looks like it is using a xml file to save my values, I can save and load settings easily, my question is if I compile the source to an application, where does it hold these values? Does it make a xml filesomewhere, if it does, then where? I compiled a program and changed some settings, then I transferred this executable to my mom's computer but it had default values in options. When I made changes with application in her computer, it saved everything well and it remembers those values. Where does the program create this xml file to get settings?
Asked
Active
Viewed 270 times
5 Answers
1
On my Windows 7 it saves the settings under
C:\Users\<user>\AppData\Roaming<application name>\<exefile name>\<version>\user.config

Pauli Østerø
- 6,878
- 2
- 31
- 48
1
The question has been asnwered here
The user.config file is created in the <c:\Documents and Settings>\<username>\[Local Settings\]Application Data\<companyname>\<appdomainname>_<eid>_<hash>\<verison>
folder. Where:
* <c:\Documents and Settings> is the user data directory, either non-roaming (Local Settings above) or roaming.
* <username> is the user name.
* <companyname> is the CompanyNameAttribute value, if available. Otherwise, ignore this element.
* <appdomainname> is the AppDomain.CurrentDomain.FriendlyName. This usually defaults to the .exe name.
* <eid> is the URL, StrongName, or Path, based on the evidence available to hash.
* <hash> is a SHA1 hash of evidence gathered from the CurrentDomain, in the following order of preference:
1. StrongName
2. URL
If neither of these is available, use the .exe path.
* <version> is the AssemblyInfo's AssemblyVersionAttribute setting.

Community
- 1
- 1

Ohad Schneider
- 36,600
- 15
- 168
- 198
0
inside the debug/release folder with the binary and it's named yourapp.exe.config (or web.config for web applications)
-
1True for application specific option. If you mark the setting as user-specific it goes into your user-profile folder. – Pauli Østerø Oct 13 '10 at 13:44