I want to update app. config file in windows form c# . here is a code for updating app. config
// updating
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings.Remove("name");
config.AppSettings.Settings.Add("name",txtName.Text);
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");
// show updating result on labels ( and this work fine )
string value = ConfigurationManager.AppSettings["name"];
lblName.Text = value;
this update work fine when I am running an application but when I restart application all config is reset to default