views:

26

answers:

2

I'm trying to get update values from app.config while it's running. I tried several methods but it still uses old values. How can I get correctly refresh it? I tried these but it didn't work:

MessageBox.Show(Properties.Settings.Default.MyValue);
Properties.Settings.Default.Reload();
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.Reset();
ConfigurationManager.RefreshSection("applicationSettings");
ConfigurationManager.RefreshSection("/applicationSettings/");
ConfigurationManager.RefreshSection("/configuration/applicationSettings");
MessageBox.Show(Properties.Settings.Default.MyValue);

The value of MyValue is "first value".

This first displays "first value". While the message box is still open I manually change it from my.exe.config to "second value" and the second message box still displays "first value". I'm not running the solution, I'm directly running the exe from bin folder so it's not vshost problem.

What should I do?

A: 

Did you check config in Documents and Settings/youruser (Users for Windows7)?

Michael