Refressing ConfigurationSettings.AppSettings

  • Thread starter Thread starter Jenny
  • Start date Start date
J

Jenny

Hello,

I read my applications App.Config file using
ConfigurationSettings.AppSettings

When I try to check it's last access write time using File.GetLastWriteTime

and the refresh new data from App.Config using
ConfigurationSettings.AppSettings

it does not refresh it.

Are there any ways to refresh data using ConfigurationSettings.AppSettings?

Br,

Jenny
 
Not in .NET 1.1 - the appSettings section is read one time when the
application first starts, and the only way to "re-read" it is to either
restart the app, or have a programmatic way of reading the xml configuration
file and getting the values of specific elements say, as a response to a
FileSystemWatcher event.

In .NET 2.0 we now have the ConfigurationManager.RefreshSection Method,
which
refreshes the named section so the next time it is retrieved it will be
re-read from disk.

Peter
 
Back
Top