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
The <location> element typically contains a <system. web> element and other configuration elements exactly as you use them in the Web. config file. The path attribute of the <location> element specifies the virtual directory or the file name where the location configuration items apply.
Ignoring the parent web config settings The Web. Config settings are inherited automatically from the root application, and it may raise a problem to run the Dashboard Service at IIS. To overcome this, use the location tag with path value as '. ' and inheritInChildApplications as 'false' in the Web.
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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With