I can not modify a key defined in my configuration file at the runtime (app.config) and that the change is saved when I re-run my application next time.
If I check the values at runtime I see that they actually change, but when I check the configuration file I do not see the change.
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings["MiClave"].Value = "NuevoValor";
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");
I can not understand what I'm missing.