【发布时间】:2019-02-13 18:30:55
【问题描述】:
我有一个具有 Entity Framework 6.2 的 Visual Studio 2017 项目
尝试创建 edmx 文件时出现错误
您的项目引用了最新版本的实体框架; 但是,与此兼容的实体框架数据库提供程序 找不到您的数据连接版本
我遇到过很多次,但它总是通过使用连接器安装文件夹中的 dll 并对 app.config 进行一些更改来修复
但是我现在无法让它以这种方式工作。我不知道接下来要尝试什么...我正在使用 MYSQL 8.0.12
这是我的 app.config
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.12.0" newVersion="8.0.12.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
【问题讨论】:
-
如果你有6.2,为什么重定向指向
newVersion="6.0.0.0"? -
EFs nuget 包会在安装时添加。即使一切正常,它也一直如此。
标签: c# mysql entity-framework-6