Prevent inheriting parent web.config to child Application on IIS 7.5

asp.netiisinheritanceweb.config

On IIS 7.5 I have parent site using parentAppPool and SubApplication using childAppPool.

Parent site load all fine, but when I access subApplication as http://parentSite.com/SubApplication it is expecting DLLs from Parent site bin

In order to prevent the web.config inheritance, I tried wrapping <system.web> with <location path="SubApplication" inheritInChildApplications="false"> and <location path="." inheritInChildApplications="false"> this is breaking the parent site to work.

Then I tried adding enableConfigurationOverride="false" attribute to SubApplicationPool in applicationHost.config that also didn't work

Any help would be appreciated.

high level skeleton of web.config
enter image description here

When I try this, I get Telerik error on parent site, but child site works!

'~/Telerik.Web.UI.WebResource.axd' is missing in web.config.
RadScriptManager requires a HttpHandler registration in web.config.
Please, use the control Smart Tag to add the handler automatically, or
see the help for more information: Controls > RadScriptManager

Best Answer

If there is a specific configuration that you would like to be removed from the inheritance chain, you can use the <clear/> tag to remove any previous reference setting in the parent and you can start fresh.

The following example taken from here show how to remove previous memebership details and create a new one

 <membership>
   <providers>
      <clear/>
      <add name="AspNetSqlMembershipProvider"
          type="System.Web.Security.SqlMembershipProvider, 
                System.Web, Version=2.0.0.0, 
                Culture=neutral, 
                PublicKeyToken=b03f5f7f11d50a3a"
          connectionStringName="MyDatabase"
          enablePasswordRetrieval="false"
          (additional elements removed for brevity)
       />
   </providers>
 </membership> 
Related Topic