SYSK 145: Preventing Configuration Setting Inheritance in Web Apps

If you have a website that contains nested ASP.NET web applications, by default, the settings in the root website’s configuration file inherit downward through all of the ASP.NET applications and subdirectories of the site (see for more information). 


One way to enhance application performance, maintain high reliability, and simplify administration is to restrict inheritance of configuration settings. 

The attributes frequently used to achieve that are: allowOverride, lockAttributes, lockAllAttributesExcept, lockAllElementsExcept, lockItem and lockElements (see for more information).


But did you know that you can also use a new (in .NET 2.0) attribute inheritInChildApplications to lock an entire section of settings?  Here is how you’d use it:


<location inheritInChildApplications=”false”>


       <!—Your settings here will not be inherited -->




Comments (2)

  1. Saumin says:


    I have a .net 2.0 application…and within that application, i have a .net 1.1 application. I used this setting in root (.net 2.0 app) web.config to not to inherit settings. but VS 2005 doesnt recognize it and because of this, i cannot debug from VS 2005. Is there any workaround for this? Please let me know.



  2. A while back, Steve Smith brought up a recurring problem I think most of us have bumped into, which is

Skip to main content