Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Properties.Settings.Default.Save(); -> Where is that file

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?

like image 252
Hooch Avatar asked Apr 26 '11 10:04

Hooch


2 Answers

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\

like image 195
Patrick McDonald Avatar answered Sep 26 '22 02:09

Patrick McDonald


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%

like image 26
TZHX Avatar answered Sep 27 '22 02:09

TZHX