Friday 11 April 2014

ASP.NET Restart on External Config File Changes - restartOnExternalChanges=”true” & AppSettings

If using external ASP.NET config files and you want your app to restart automatically when they're updated...

Common structure:
~/config/system.diagnostics.config
~/config/connectionstrings.config

Our testing proved that application restarts do happen when external config files were changed IF in web.config the section is declared with restartOnExternalChanges=”true”, except for AppSettings section....

<AppSettings> Exception to the Rule
AppSettings section won't accept restartOnExternalChanges attribute, so when specifying the external config file path you have to use "configSource=" to restart app on config file change, or "file=" to avoid restart.