reloading app.config after writing

Posted by rubentjeuh on Stack Overflow See other posts from Stack Overflow or by rubentjeuh
Published on 2010-05-23T19:47:36Z Indexed on 2010/05/23 19:50 UTC
Read the original article Hit count: 177

Filed under:
|
|
|
|

Hi,

When I use this to write to my app.config file:

Configuration config =ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings["Wachtwoord"].Value = "Test";
config.Save();
ConfigurationManager.RefreshSection("appSettings");

I can read it again. But when i close and restart the program, the value of "Wachtwoord" has changed again to the old value.

Does anybody how I could fix this?

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about refresh