user.config

This fileis a user configuration file
Introduced in .NET Framework 2.0
This is not created by default when an application is installed but is created the first time a user setting is saved/modified in the code.


Windows 7 - existing
Windows 7 - C:\users\"---"\AppData\local\Microsoft_Corporation\


Any settings that have a scope of "user" will be saved into this


Properties.Settings.Default.Save(); 
Properties.Settings.Default.Upgrade

C:\Documents and Settings\"---"\local settings\Application Data\ 
Microsoft_Corporation\AppName.dll.manifest_XXXXX\12.0.06668.500000\

Settings.Settings File

A settings file is also automatically generated
Double clicking on this file will display the settings tab from the project properties window.



Settings.Designer



Location

You can obtain the location of the user.config file by using the following

System.Configuration.Configuration objConfig; 
objConfig = System.Configuration.ConfigurationManager.OpenExeConfiguration(
System.Configuration.ConfigurationUserLevel.PerUserRoaming);
string sFolderPath = objConfig.FilePath;

Sample File

<?xml version="1.0" encoding="utf-8"?> 
<configuration>
   <userSettings>
   </userSettings>
</configuration>


© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext