Welcome to MSDN Blogs Sign in | Join | Help

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 http://msdn2.microsoft.com/en-us/library/ms178685.aspx 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 http://msdn2.microsoft.com/en-us/library/ms228167.aspx 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”>

    <system.web>

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

    </system.web>

</location>

 

Published Tuesday, June 27, 2006 4:40 AM by irenak

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: SYSK 145: Preventing Configuration Setting Inheritance in Web Apps

Wednesday, May 16, 2007 9:48 AM by Saumin

hi,

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.

Thanks!

Saumin

# Isolating Web Settings from Sub-Applications using InheritInChildApplications

Wednesday, June 20, 2007 11:07 AM by J. Ambrose Little

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

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker