I get an Unrecognized element 'providers' exception at runtime when I use Entity Framework 5.0.0 with .NET 4.0. Actually with .NET 4.0 it's the version 4.4.0 of Entity Framework that is loaded when I do an install-package with NuGet. When I check the properties of the file from explorer I can see this:
Here is my config file
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<connectionStrings>
<add name="xxx" connectionString="metadata=res://*/StreetMusicModel.csdl|res://*/StreetMusicModel.ssdl|res://*/StreetMusicModel.msl; provider=MySql.Data.MySqlClient;provider connection string=' server=xxx.net; user id=xxx; password=xxx; database=xxx'" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v12.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity" />
</providers>
</entityFramework>
I have the feeling Entity Framework 4.4.0 is not able to recognize the tag. Can I just remove or rename the section? When I remove the section I get another exception: The underlying provider failed on Open.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…