I am using ConfigurationManager.AppSettings collection to retreive configuration values from a Web.config file in an ASP.NET application. Does anyone know if values in AppSettings get cached in memory somehow or if a file read of Web.config occurs every time when retrieving a setting?
string someValue = ConfigurationManager.AppSettings["SomeSetting"];
Thanks
They are taken from memory, since the web.config is read only once when the application starts.
However, ASP.NET monitors the web.config file to detect and load changes
Application Configuration Files Explained in MSDN
For more info:
http://weblogs.asp.net/stevewellens/archive/2011/01/15/web-config-is-cached.aspx