2

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?

Badr Hari
  • 8,114
  • 18
  • 67
  • 100

5 Answers5

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)

0

I think you are referring to App.config?

Bryce Fischer
  • 5,336
  • 9
  • 30
  • 36
0

Check out http://msdn.microsoft.com/en-us/library/k4s6c3a0.aspx.

Holstebroe
  • 4,993
  • 4
  • 29
  • 45