I have a child MVC application running in IIS8.5 under another parent MVC application.
As expected, the child application inherits the parents Web.Config settings.
The issue that I have is that the child application inherits the <EntityFramework> section which I need to prevent it doing. How do I achieve this?
I've seen a number of different questions that ask a very similar question but none of them have worked to prevent <EntityFramework> inheritance.
I have so far tried:
- Issolating the application pool of the child application
- Changing the directory to a virtual directory
- Adding
<virtualDirectoryDefaults allowSubDirConfig="false" />within theapplicationHostfile - Adding
enableConfigurationOverride="false"to the application pool profile in theapplicationHostfile
Update
I'm specifically having issues with code first migrations. The following <context> is inherited from the parent Web.config file but is not wanted in the child application:
<context type="SomeApp.Models.DataContext, SomeApp">
<databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[SomeApp.Models.DataContext, SomeApp], [SomeApp.Migrations.Configuration, SomeApp]], EntityFramework, PublicKeyToken=someToken">
<parameters>
<parameter value="SomeConnection_DatabasePublish" />
</parameters>
</databaseInitializer>
</context>
The main issue is that this context has a dependency on a dll that is not in the child application.