Using configSource and changing restartOnExternalChanges for the main section

I would like to use the configSource attribute of my web configuration section to define external files for various settings.

In particular, the appSettings section. This means that my configuration file has the following entry:

<appSettings configSource="My.AppSettings.config" />

However, if this file is updated, the settings will not be automatically selected, which would be if the parameters were manually included in the web.config file

Further research leads me to the attribute restartOnExternalChanges . Apparently, this can be used with elements <section/>to determine whether externals identified by configSource can trigger reloads or not. Large! or so I thought.

However, when I try to determine the appSettings section and change the value of the restartOnExternalChanges parameter, I see the same error as here , because the appSettings section is defined in the machine.config file, a file that I cannot change.

Does anyone know if it is possible for these two parameters to work together for partitions already defined at a higher level?

+5
source share
1 answer

Try this configuration.

<section 
    name="MyAppSettings" 
    type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
    restartOnExternalChanges="true" 
    requirePermission="false" />
+3
source

All Articles