views:

104

answers:

5

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?

A: 

inside the debug/release folder with the binary and it's named yourapp.exe.config (or web.config for web applications)

Stefano
True for application specific option. If you mark the setting as user-specific it goes into your user-profile folder.
BurningIce
+1  A: 

On my Windows 7 it saves the settings under

C:\Users\<user>\AppData\Roaming<application name>\<exefile name>\<version>\user.config
BurningIce
A: 

I think you are referring to App.config?

Bryce Fischer
+1  A: 

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.
ohadsc
Thank you for your answer!
Badr Hari
My pleasure! And good luck with your K-1 career ;)
ohadsc