15

I have app that uses Settings. To save settings I use:

Properties.Settings.Default.Save();

To read tham I use:

Properties.Settings.Default.MyCustomSetting;

In my folder with application I have only exe file. No config files. My application works good, can read write settings.

Where is that file located if it is not in application folder?

Hooch
  • 28,817
  • 29
  • 102
  • 161
  • 2
    duplicate of http://stackoverflow.com/questions/481025/where-property-setting-value-stored-in-c-windows-application – V4Vendetta Apr 26 '11 at 11:04

5 Answers5

18

On My Windows XP machine, the settings are saved in a file called user.config somewhere under either C:\Documents and Settings\<UserName>\Application Data\ or C:\Documents and Settings\<UserName>\Local Settings\Application Data\

Update:

On Windows Vista and later, the locations have changed to C:\Users\<UserName>\AppData\Roaming\ and C:\Users\<UserName>\AppData\Local\

Patrick McDonald
  • 64,141
  • 14
  • 108
  • 120
5

This depends on what SettingsProvider you are using. By default, this is the LocalFileSettingsProvider

Quoting from that page:

Application-scoped settings and the default user-scoped settings are stored in a file named application.exe.config, which is created in the same directory as the executable file. Application configuration settings are read-only. Specific user data is stored in a file named user.config, stored under the user's home directory.

They may also go to the %APPDATA%

TZHX
  • 5,291
  • 15
  • 47
  • 56
2

On my Windows 7 machine, it's saved in:

Users\\AppData\Local\MyCompanyName\MyExeName\1.0.0.0\user.config

Replace MyCompanyName with something specific to you, and replace MyExeName with the name of your Exe. Mine is followed by a lot of random characters.

This threw me, too. I'm glad I'm not the only one. :) I hope this helps!

John
  • 313
  • 5
  • 9
2

you can get the path programmatically:

var path = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath;
Textbox1 = path;
Namitha
  • 81
  • 1
  • 7
0

I don't know the specifiek path but i think it's in documents and settings Place a breakpoint on the Save and the path should be visable in one of the members/submembers of Properties.Settings.Default

see this post

Community
  • 1
  • 1
Frederiek
  • 1,605
  • 2
  • 17
  • 32