10 Things ASP.NET Developers Should Know About Web.config Inheritance

added by jongalloway
1/17/2012 9:16:05 PM

11 Kicks, 1434 Views

Ten things you should know about Web.config inheritance and overrides that will simplify some configuration challenges and help with debugging. Bet there are some you didn't know about!


1/18/2012 10:23:18 AM
Disinheriting your child applications with inheritInChildApplications="false"

If you are writing open source software like a CMS or Blog please please please use this vigilantly - otherwise people trying to host apps in sub virtual directories will inherit all of your settings.

If they don't then you have to use:

Clearing parent settings when adding to a collection

1/18/2012 10:33:21 AM
Using transforms is a great idea to handle differences in environments. A much better option than stepping on your teams toes or constantly mucking with the web.config manually for different environments.

1/18/2012 11:50:06 AM
For some reason in our environment, it does not appear that the Debug.config transformations are applied when the project is built as the article indicates, but only when it is published.

1/18/2012 6:29:10 PM
Some useful tips. I didn't actually know any of 4, 6, 7, which could definitely be pretty useful.

I still hate web.config files, as they're big bloated pieces of semi-comprehensible XML, but oh well!

1/21/2012 12:15:49 AM
Very useful tips. It is useful to see the machine.config and root web.config for process settings as well as information about modules and handlers.