it will work.
Thanks,
Levent Dagistanli
"Andrew" wrote:
Hi,
I've tried the code out with reference from msdn and I've got the same
problem as well.
When going thru the stepbystep debugger, I can see the values being added to
the ConfigurationManager, but somehow the values are not being save to the
app.config file.
eg.
using System.Configuration;
ConfigurationSection section =
(ConfigurationSection)config.GetSection("appSettin gs");
//Read the key in the app.config file
AppSettingsSection assection = config.AppSettings;
string str = assection.Settings["aaa"].Value.ToString();
// Add an Application Setting.
config.AppSettings.Settings.Add(asName, "test_value");
// Save the configuration file.
config.Save(ConfigurationSaveMode.Modified);
// Force a reload of a changed section.
ConfigurationManager.RefreshSection("appSettings") ;
Is there an error in my code ? Any feedback is appreciated.
cheers,
Andrew