6

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

HaBo
  • 13,999
  • 36
  • 114
  • 206

2 Answers2

1

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> 
cableload
  • 4,215
  • 5
  • 36
  • 62
  • 1
    Well I would like to completely void the inheritance behavior here. How would i do that? – HaBo Apr 14 '16 at 13:35
  • You are using `` Instead try `` More [info](http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc245724860) – cableload Apr 14 '16 at 13:40
  • Try [this](http://stackoverflow.com/questions/782252/avoid-web-config-inheritance-in-child-web-application-using-inheritinchildapplic) as well – cableload Apr 14 '16 at 14:01
  • Do I have wrap that in parent web.config or child web.config? – HaBo Apr 14 '16 at 15:11
  • Added it to system.web and system.webserver The configuration section 'location' cannot be read because it is missing a section declaration – HaBo Apr 14 '16 at 15:23
  • I have updated my question. That helped to load the child site, but parent site is getting telerik error – HaBo Apr 14 '16 at 15:35
  • the location path that you added above is it in parent web.config or child ? My understanding was it has to be added in the parent web.config. – cableload Apr 14 '16 at 15:41
  • Yes in Parent web.config – HaBo Apr 14 '16 at 15:59
0

Using the <location> element I was able to disable the inheritance.

enter image description here But that raised new error with Telerik controls

'~/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

In order to solve that, I used EnableHandlerDetection attribute as mentioned in this Telerik.Web.UI.RadScriptManager Documentation

EnableHandlerDetection Boolean

Gets or sets a value indicating if RadScriptManager should check the Telerik.Web.UI.WebResource handler existence in the application configuration file.

Remarks

When EnableHandlerDetection set to true, RadScriptManager automatically checks if the HttpHandler it uses is registered to the application configuration file and throws an exception if the HttpHandler registration missing. Set this property to false if your scenario uses a file to output the combined scripts, or when running in Medium trust.

Then I ended up with another error

HTTP Error 500.22 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

To resolve that I made the following changes to <system.webserver>

 <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>

  <location path="." inheritInChildApplications="false">
  <system.webServer>
    <!--<validation validateIntegratedModeConfiguration="false" />-->
    <modules runAllManagedModulesForAllRequests="true">
    .... other stuff
   </system.webServer>
  </location>
HaBo
  • 13,999
  • 36
  • 114
  • 206