Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Remove("Custom"); config.AppSettings.Settings.Add("Custom", txtValue.Text); config.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection("appSettings");