User Level - user.config

Added in .NET 2.0
This file is a user configuration file
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.


Location
C:\users\"---"\AppData\local\Microsoft_Corporation\


<configSections> 
</configSections>

<system.diagnostics>
</system.diagnostics>

<system.serviceModel>
</system.serviceModel>

<userSettings>
</userSettings>

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>


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