Saturday, March 1, 2008

How to Disable Configuration Inheritance in ASP.NET Child Applications

Configuration inheritance is a very good feature of ASP.NET. It allows you to set configuration settings in the Web.Config file of a parent application and have it automatically be applied to all of its child applications.

But sometimes you do not want the child applications to inherit the Configuration from its parent application. In order to solve this issue you use the following code:
<location inheritinchildapplications="false" path=".">
  <system.web>
    <!--System.web Configurations goes here -->
  </system.web>   
</location>
The above code would prevent the child application from inherit the configuration from the parent application.
Source: https://www.nilebits.com/blog/2007/04/disable-configuration-inheritance-in-asp-dot-net/