10. January 2008 00:10
I ran across a situation working on an Intranet application where I did not want a sub directory (which was a seperate web application) to inherit the parent/root web applications web.config settings. I searched around and found an article about the lock attributes for sections and elements in the web.config, but that was not working. Basically what was happening is that when I went to the sub application via http://mainsite/subApp the subApp would fail because it said it couldn't find a reference to a setting I had in my root applications web.config (in my case it was a tagMapping and HttpModule settings).
The following takes care of this type of situation.
In the root web.config file I wrapped my <system.web> section with the following tags:
<location path="." inheritInChildApplications="false">
This allows all child applications to use its web.config only and not worry about anything in the parents web.config. The following URL is an MSDN article about it: