Search code examples
asp.netiisweb-config

Finding final/effective web.config values (from inherited configurations)


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.


Solution

  • 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:

    And there are special exceptions for sections, such as "processModel" settings. For more information / overview details, see: