Nested ASP.NET ‘application’ within IIS inheriting parent config values?

The exact solution to your problem will depend on what configuration exception message you are seeing. However, this is a typical problem that can often be solved through use of the inheritInChildApplications attribute on the location element in the web.config for “WebParent”. By wrapping the entire system.web section in a location element as follows, you should be able to eliminate the problem you described:

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

With IIS 7, you will also want to wrap the system.WebServer section the same way:

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

This solution is based on an excellent blog article that I found here.

Leave a Comment