Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); AppSettingsSection configSection = config.AppSettings; try { if (configSection != null) { if (configSection.IsReadOnly() == false && configSection.SectionInformation.IsLocked == false) { configSection.Settings["myKey"].Value = "newValue"; config.Save(); } } } catch (ConfigurationException ex) { MessageBox.Show(ex.Message, "Configuration Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }