When is the <appSettings> section used over the custom configuration section?
When creating my application or library configuration, I usually prefer to use the custom configuration section in the <appSettings> section for the following reasons.
- Serialization of the structure into a user configuration object; each configuration value has a corresponding type
- Configuration values ββcan be checked to match ranges of types and values ββwith attributes
Given this, when do I want to use the input / subtraction mechanism of the <add/> type of the <add/> section of the <appSettings> ? As far as I remember, the application level configuration in this section can override the existing machine level configuration from machine.config. Is this the only case, or are there other reasons?
The appSettings tag has a file attribute that allows you to redirect the entire appSettings section to an external file. For example, you may have different instances of appSettings for different environments: dev.config, qa.config, etc. I'm not sure if you can do this with other configuration sections.
Example:
<appSettings file="qa.config"/>