I have a site running in a subdirectory of another site. They run in separate app pools. The two sites are running different versions of Entity Framework. So in the web.config in the subdirectory I have:

<remove name="entityFramework"/>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

But even with the <remove> tag I still get this error:

Section or group name 'entityFramework' is already defined. Updates to this may only occur at the configuration level where it is defined.

I've also placed <location> tags in the parent web.config wherever possible:

<location path="." inheritInChildApplications="false">

The <location> tag is present around the parent web.config's <entityFramework> section.

And I've placed enableConfigurationOverride="false" in the applicationHost.config files for IIS (both files in System32 and SysWOW64).

How do I prevent the site in the subdirectory from seeing the parent entityFramework tag?

Related posts

Recent Viewed