Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web.config inheritInChildApplications="false" for configSections?

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.

like image 601
Jason Eades Avatar asked Aug 31 '25 11:08

Jason Eades


1 Answers

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.

like image 180
competent_tech Avatar answered Sep 02 '25 23:09

competent_tech