Are there any apps that can show the final configuration as applied to a particular application directory? What I'm picturing is something along the lines of FireBug's CSS viewer.
Basically, it should show the equivalent single web.config file (as if you only had one), with all the values that apply to the directory in question, with each element (or even attribute) annotated with its source (the real .config file it came from).
This would greatly help deploying applications into foreign environments (eg, customer sites) where they sometimes have strange configs, that add in global includes (eg, they put the include in machine.config, instead of the web.config for that app) or have allowOverride=false, etc.
If you know the config sections you are interested in then this will give you the effective settings as a class specifically for those settings. You could then cast the type and retrieve the settings that way and do the same for any sections you're interested in.
object vals = System.Configuration.ConfigurationManager.GetSection("AppSettings")
However, I don't know of any way to retrieve all of the current config sections if you want to discover all of the sections using code.
None currently exist that are publicly known, however a viewer could easily be written. I would analyze reflected source of the .NET CLR regarding configuration inheritance and value determination. The code logic that calculates the final configuration for a domain is quite specific, so it makes sense no viewer currently exists for your request and this would be a good starting point for a viewer you envision.
Regarding making deployments, comparisons and editing config files easier, I personally recommend trying ASPhere. It's currently the best GUI editor for .NET config files, although it is not open source.
There are of course, additional helpful examples reading / accessing config files:
Setup and App config editor
Read/Write App.Config File with .NET 2.0
Using the Configuration Classes
Runtime Web.config / App.config Editing
And there are special exceptions for sections, such as "processModel" settings. For more information / overview details, see:
MSDN - ASP.NET Configuration File Hierarchy and Inheritance
MSDN - General Attributes Inherited by Section Elements
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With