app.config I can't add or remuve values.
-
Hi all I am trying to save my settings into app.config but it doesn't work. I can read data but I can't save it. I see no error. Can you give me a hint. Here is my code. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Remove("ClientPort"); config.AppSettings.Settings.Add("test", "23232"); config.Save(ConfigurationSaveMode.Full, true); ConfigurationManager.RefreshSection("appSettings"); Thanks.
-
Hi all I am trying to save my settings into app.config but it doesn't work. I can read data but I can't save it. I see no error. Can you give me a hint. Here is my code. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Remove("ClientPort"); config.AppSettings.Settings.Add("test", "23232"); config.Save(ConfigurationSaveMode.Full, true); ConfigurationManager.RefreshSection("appSettings"); Thanks.
daavena wrote:
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
User based .config files live in another location, somewhere in Documents and Settings/Username/blah/blah. You probably want to use: PerUserRoamingAndLocal
xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 4a out now (29 May 2008)