In my previous blog post I talked about creating complex configuration objects from AppSettings. I really like this practice, but it can cause your config files to grow pretty large. One solution is to break your app.config into multiple files using the SectionInformation.ConfigSource property.
This also has the added side effect of allowing you to include defaults and overrides by having those settings cascade. I have created an extension method to combine a series of NameValueCollections, such as an AppSettings section. You can also grab this code from the GitHub project.
Combine Extension
public static NameValueCollection Combine(
this NameValueCollection collection,
params NameValueCollection[] collections)
{
var result = new NameValueCollection { collection };
foreach (var subCollection in collections)
foreach (var key in subCollection.AllKeys)
{
if (result.AllKeys.Contains(key))
continue;
var value = subCollection[key];
result.Add(key, value);
}
return result;
}