Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reloading configuration without restarting application using ConfigurationManager.RefreshSection

Has anyone got this working in a web application?

No matter what I do it seems that my appSettings section (redirected from web.config using appSettings file=".\Site\site.config") does not get reloaded.

Am I doomed to the case of having to just restart the application? I was hoping this method would lead me to a more performant solution.

Update:

By 'reloading' I mean refreshing ConfigurationManager.AppSettings without having to completely restart my ASP.NET application and having to incur the usual startup latency.

like image 677
Kieran Benton Avatar asked Oct 07 '08 16:10

Kieran Benton


1 Answers

Make sure you are passing the correct case sensitive value to RefreshSection, i.e.

ConfigurationManager.RefreshSection("appSettings"); 
like image 183
G-Wiz Avatar answered Sep 23 '22 21:09

G-Wiz