3

I have created a virtual directory and converted it to its own application and put it in it's own app pool and it's still inheriting settings from the root apps web.config file, it there anyway to stop this from occuring?

Sam Cromer
  • 687
  • 3
  • 12
  • 31
  • 1
    http://stackoverflow.com/questions/782252/avoid-web-config-inheritance-in-child-web-application-using-inheritinchildapplic – Chris Diver Sep 10 '13 at 14:58
  • Follow Chris's link, but beware that the accepted answer doesn't seem to be quite correct. Look for the second answer with all the upvotes instead. – criticalfix Sep 10 '13 at 15:09

1 Answers1

2

This is something that has caused me headaches for the past 18 years (since I work with .NET and IIS). This inheritance has never served any benefit but has caused numerous unexpected broken websites (you update the root and don't realize it breaks the child or you tested the child in an environment with a different root and when publishing it stops working).

So I decided today to search again and found something that works on a microsoft forum, but you need to change the parent not the child website. Put location tags around the system.web node of the web.config of the root website

<location  inheritInChildApplications="false">
<system.web>
 ...
</system.web>
</location>
Pang
  • 9,564
  • 146
  • 81
  • 122
Koen
  • 49
  • 6