After I installed latest EntityFramework 4.3.1 to my MVC3 project, I decided to start using new
Migrations feature.
But then, my project won't build and give this error:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
There is a duplicate 'entityFramework' section defined
Config Source:
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
So it builds and works fine when I disable this section in web.config:
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
But when I disable it, and then I ran
Enable-Migrations
and then
Add-Migration [Some_Name]
to create an initial named migration, I get this error:
The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.
So my question is - is there a way to use
Migrations without disabling/enabling configSection in web.config, or what I am missing?