How to Stop inheritance of web config files

0 comments

You will need to wrap <system.web> and anything you do not want to be inherited into <location path=”.” inheritInChildApplications=”false“></location>

For example:

 

<location path=”.” inheritInChildApplications=”false“> 

     <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
     <!-- these settings can be found in external files - this prevents application restart when they are changed -->
     <connectionStrings configSource="Web_ConnectionStrings.config"></connectionStrings>
     <appSettings configSource="Web_AppSettings.config"></appSettings>
     <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
    <system.web> 
        … 
    </system.web> 
</location>

 

 

Here are some references:

http://www.dondraper.com/2010/02/how-to-stop-inheritance-of-webconfig-files/

http://www.kowitz.net/archive/2007/05/16/stopping-asp-net-web-config-inheritance

http://manual.aspdotnetstorefront.com/p-1227-how-to-stop-aspnet-applications-from-inheriting-any-config-files-in-parent-applications.aspx

IIS

Comments


Leave a Comment