Pages Menu
TwitterRssFacebook
Categories Menu

Posted by on 27th June, 2009

Web.config inheritance tip…

Web.config inheritance tip…

Mainly writing this entry so I don’t spend hours looking for a solution when I need it again, since I tend to forget rather quickly how exactly I solved a problem. In this case, I have a website that is ASP.NET 3.5 and a folder which contains a different .NET application. I understand that the web.config in the root of the site, will cascade down into the applications within by default. What if our application within uses different settings… how do we prevent the settings in the root to affect the child applications? Well, I learned that this can be accomplished in two parts. First there is a somewhat undocumented trick to instruct IIS that we do not want the settings to be inherited by child applications. You will need to wrap your <system.web> tag in a new tag, named <location> with the attributes as shown below: Web.config inheritance <location path="." inheritInChildApplications="false" > <system.web> [...] </system.web> </location> Note that this will show a red squigly line in Visual Studio...

Read More