msview msview - 1 year ago 107
ASP.NET (C#) Question

Are external config sections in web.config cached?

I have my own custom configuration section, like this

<section name="ConnectionStrings"
type="System.Configuration.AppSettingsSection, System.Configuration, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
requirePermission="false" />

and I keep it in an external file like this

<ConnectionStrings configSource="connections.config"/>

I know that web.config is cached, and when I change the config, IIS resets the cache and reread the config again after restart...

But In my case, when I change my external config
IIS doesn't restart the app because I set

Question: Is my external config cached as well? or IIS reads from it all the time when I use

Answer Source

Sure, it is cached as well. The API ConfigurationManager.GetSection provides read-only view of the underlying configuration settings.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download