5

I'd like to use the configSource attribute of my web config section to define external files for various settings.

Particularly, the appSettings section. This means my config file has the following entry:

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

However, if this file is updated, the settings are not automatically picked up, which would have been the case if the settings were manually included in the web.config

Further investigation lead me to the restartOnExternalChanges attribute. This can apparently be used with <section/> elements to define whether externals files identified by configSource can trigger restarts or not. Great! or so I thought.

However, when trying to define the appSettings section, and changing the restartOnExternalChanges value, I see the same error encountered here, because the appSettings section is defined in the machine.config - a file I cannot change.

Does anyone know if its possible to get these two settings to work together, for sections already defined at a higher-level?

MattH
  • 4,166
  • 2
  • 29
  • 33

1 Answers1

2

Try this configuration instead.

<section 
    name="MyAppSettings" 
    type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
    restartOnExternalChanges="true" 
    requirePermission="false" />
gnfontaine
  • 44
  • 2
  • 2
    Where is this supposed to go, the machine.config file? – Omar Nov 05 '10 at 02:15
  • 3
    I'm having the same problem, but with the section. I'd like to have but I'm getting error 500 when I use restartOnExternalChanges in that section. Is there a way of doing it as a variation of your solution? This is on IIS7 of course. – ingredient_15939 Nov 22 '11 at 13:21
  • Can you explain your example, or give an link for more information ? – Jeroen May 25 '21 at 12:43