//ConfigurationManager.RefreshSection("appSettings");
string settingValue = ConfigurationManager.AppSettings.Get("setting1");
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
string settingValue = config.AppSettings.Settings["setting1"].Value;
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings["setting1"].Value = "123";
config.Save(ConfigurationSaveMode.Modified);
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="setting1" value="123" />
</appSettings>
</configuration>