开发者

How/Where/When is .net app.config NON-APPSETTINGS elements stored?

开发者 https://www.devze.com 2023-02-04 02:14 出处:网络
Folks, Tons of articles are written about appSettings in app.config.For all the other sections (like system.ServiceModel), I\'m trying to understand:

Folks,

Tons of articles are written about appSettings in app.config. For all the other sections (like system.ServiceModel), I'm trying to understand:

1. When the data is 开发者_JAVA百科loaded

2. Where is it stored - accessible via object model?

3. Can be it changed? Can values be manipulated? Can an entire section be reloaded? Can an entire section be reloaded from a different xml source?

Perhaps my google skills are poor - but every article wants to talk about appSettings specifically.


The values for other settings inside a web.config file are loaded when IIS pulls the website into the current app pool. This starts up the process with the configuration settings set in the .config file. IIS is notified when the file changes and will recycle the process that the website is running to reflect the new values when changes to the file occur.

Most (if not all) configuration options are available via the config file or through the System.Configuration namespace. Usually, you only want to set or change these values at the application on start event.


I'm not 100% about #1, but for the other 2 I believe:

2 - If you create your own "config models" (I forget the name here) then you access them via an object model.

3 - Values can't be changed by your program at runtime, app.config is just for reading configuration.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号