Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings.Remove(FAVORITE_CONFIG_FIELD);//FAVORITE_CONFIG_FIELD is a const that contains the correct field in the config file
config.AppSettings.Settings.Add(FAVORITE_CONFIG_FIELD, sb.ToString());//I've checked, sb.ToString() gives a different value than the actual
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");
//my app.config doesn't have change
|