Wednesday, 15 August 2007

.Net 2.0 configuration reload

In .Net 1.0, if you have changed the app.config settings of a service, a restart is require to pick up the setting. Web applications automatically restart when web.config is modified.

.Net 2.0 allows you to refresh cached application configuration setting with the following method:

ConfigurationManager.RefreshSection("appSettings");

which refreshes the named section so the next time it is retrieved it will be re-read from disk.

No comments:

Post a Comment