Preventing Web Applications from Inheriting Parent Dependencies (bin)

Have you ever created a web application for something specific such as a standalone web app (forum, photo gallery, web service, etc.) while using ASP.NET and received this:

image

If you have, you probably became frustrated. I know I have. The reason  this occurs is that sub-applications under the main web application inherit the uplevel web.config settings. This means that the machine.config and other system config files filter into the main web’s web.config file as well.

You can prevent this from occurring as details quite well at http://jasong.us/yXCV8P.

To do this, you’ll need to pull your dependencies and wrap them in a location element and add a attribute as shown below:

This will now load only the dependencies within the application.

<location path="." inheritInChildApplications="false">
    <system.web>
        <!-- Compilation section with assemblies -->
    </system.web>
</location>

You can also circumvent this issue by using sub-domain or another domain altogether.



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=""> <strike> <strong>