InheritInChildApplications attribute not recognized in web.config location element
Solution 1
Shouldn't it be a lowercase 'i'?
<location path="." inheritInChildApplications="false">
I have been using it successfully on the last 4 or 5 projects I have worked on. My spec is similar to yours. I'm still using .NET 4 RC. I also include the system.webServer settings within location.
Good luck,
Rich
Solution 2
It could be because you don't have a namespace specified on the root node? eg
You need
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
not
<configuration>
Solution 3
I think the issue here is that inheritInChildApplications
is not a valid attribute of the location node in .net 4.0.
The reason the above fix works is because you are specifically targeting the .net 2.0 configuration schema
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
.net 4.0 privdes a different way of dealing with config inheritance.
See http://msdn.microsoft.com/en-us/library/b6x6shw7.aspx and http://msdn.microsoft.com/en-us/library/ms178692.aspx for more details.
Solution 4
I use clear quite often to achieve this:
<configuration>
<system.web>
<assemblies>
<clear>
<clientTarget>
<clear>
<compilation>
<compilers>
<clear>
<httpHandlers>
<clear>
<httpModules>
<clear>
<serviceDescriptionFormatExtensionTypes>
<clear>
<webServices>
<protocols>
<clear>
<soapExtensionTypes>
<clear>
<soapExtensionReflectorTypes>
<clear>
<soapExtensionImporterTypes>
<clear>
Related videos on Youtube
mare
Software project manager and fullstack developer at Centiva, Slovenia. Focusing on web and mobile development using open web technologies like HTML5, JavaScript/TypeScript, Svelte/Angular, REST services, document and relational databases, cloud and containers.
Updated on July 09, 2022Comments
-
mare almost 2 years
I've tried wrapping my
<system.web>
with
<location path="." InheritInChildApplications="false">
like this
<location path="." InheritInChildApplications="false"> <system.web>...</system.web> </location>
But VS 2010 Web Developer Express keeps saying
The 'InheritInChildApplications' attribute is not allowed
When I run my web app there's an error:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.Config Error Unrecognized attribute 'InheritInChildApplications'.
My configuration: ASP.NET 4.0 RTM, VS 2010, IIS 7.5
-
ak3nat0n over 13 yearsDid you ever get this to work? I am having the same issue ...
-
mare over 13 yearsnope, I solved my issues in root app but the application in a sub folder never worked.
-
-
mare about 14 yearsAaarrrgh! LOL! It's capitalized in MSDN manuals, so I used it as such.
-
mare about 14 yearsOk, the root website is working now, but the subdirectory (configured as an aplication) still tries to load the contents of my 'namespaces' element.
-
kim3er about 14 yearsThat sucks. Let me know if it works. It's worth flagging it on MSDN.
-
kim3er about 14 yearsHave you changed the default application name of the sub app?
-
BrunoLM about 13 yearsThere is one problem with it... The web transforms doesn't work with the correct namespace...
-
Mark over 12 yearsThanks - that also cleaned up a couple of other warning that have been bugging me :)
-
dotjoe about 12 yearsseems .net 4 brought the attribute back?
-
bradjive over 11 yearsThis worked for me. Should probably mark this is as the correct answer based on votes.
-
user1069816 over 11 yearsI tried this and got the error: HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. The configuration section 'clear' cannot be read because it is missing a section declaration
-
Sparkle over 11 yearsJust set it above the nodes you wish to clear. <namespaces> <clear /> or <providers> <clear /> or <appSettings> <clear /> etc etc etc
-
Sparkle over 11 yearsI don't like turning off the inheritance altogether so I prefer to use clear where I need to.
-
shashwat almost 11 yearsit seems that this schema has problem in loading. When accessing this url directly in browser it is giving error. I think it should an xml file.
-
napster almost 11 yearsI don't think it has to refer to an actual file, it just has to match what VS is expecting.
-
David Ewen about 9 yearsIf you want to get web transforms working again you also need to define the xmlns in the transform against the configuration node like this
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
-
Si8 about 7 yearsCan I put that around the entire Web.config or just system.web?