IIS: Virtual Directory Not Using web.config from Parent Directory

As we know, when application is placed on virtual directory, the web.config (or configuration) also will be inherited the configuration of parent directory application. Sometimes it will cause problems because parent directory contains library (.dll) that doesn’t exist in virtual directory application. So, for the virtual directory application only using web.config itself, the web.config of parent directory application should be added <location> tag with attribute inheritInChildApplications set as false that encapsulate <system.web> and <system.webServer>.

This is the sample:
[code lang=”xml”]
<configuration>
<location path="." inheritInChildApplications="false">
<system.web>

</system.web>
</location>

<location path="." inheritInChildApplications="false">
<system.webServer>

</system.webServer>
</location>
</configuration>
[/code]

Septu Jamasoka has written 23 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>