views:

165

answers:

1

After application start up ,if i change some value in app.config ,is it reflected in cache object through which i access appconfig properties.

    string currentValue = ConfigurationSettings.AppSettings[currentKey];

If it is not so what is possible way to do so?

+2  A: 

No, it is not automatically updated. To force a refresh you could use the RefreshSection method:

Console.WriteLine(ConfigurationManager.AppSettings["test"]);
Console.WriteLine("Now modify app.config value");
Console.ReadLine();
ConfigurationManager.RefreshSection("appSettings");
Console.WriteLine(ConfigurationManager.AppSettings["test"]);
Darin Dimitrov