I have a .NET 4.0 application on IIS 7 that contains a nested .NET 2.0 application. The problem is that the the nested .NET 2.0 application has the system.web.extensions sectionGroup within the <configSections>
of the web.config and the .NET 4.0 parent applications machine.config contains those sectionsGroups as well. This causes status code 500 server error.
Commenting out the system.web.extensions sectionGroup from the child applications web.config works but isn't an option with our setup.
How can I prevent inheriting the parent web.config in the child application? I've seen that <location path="." inheritInChildApplications="false">
was used in previous .NET versions but what do I wrap the location element around?
Intellisense shows me that "The inheritInChildApplications attribute is not allowed" and it doesn't appear to matter where I put it.
We wrap all of the settings that we don't want inherited in an empty location element:
<location inheritInChildApplications="false">
Intellisense complains about it, but it seems to run just fine in production mode.
There is some good additional information in this article.
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