简体   繁体   中英

Nesting web applications in IIS 7 and keeping child apps from inheriting Parent web.config

I have am trying to use the location attribute to to set inheritInChildApplications = false so that I can nest a second application under an existing IIS application without config conflicts.

There's a problem however. The second application www.mydomain.com/SecondApp/home will load but now all pages from the Parent application will not load ie www.mydomain.com/aboutus throws an exception because the HttpHandlers were not loaded.

How can I get the httpHandlers to load on the subpages of the parent site but not in the second application?

I've been using location as follows:

<location path="." inheritInChildApplications="false">
    <system.web>
        <!-- Stuff -->
        <httpHandlers>
            Blah
        </httpHandlers>  
    </system.web>
 </location>




<location path="." inheritInChildApplications="false">
        <system.webServer>
            <!-- Stuff -->
            <handlers>
                Blah
            </handlers>  
        </system.webServer>
     </location>

The way that I ended up fixing the solution was to remove the offending handlers, modules, extensions and assemblies from the child config and not using location. ie:

<httpHandlers>
     <remove name="offendingHttphandler" />
     Rest of the good handlers
</httpHandlers>

PS just pray that the nested application does not a different application pool that uses a different pipeline or version of .NET. Just pray. Otherwise this solution will not work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM