简体   繁体   English

MySQL与实体框架6

[英]MySQL with Entity Framework 6

I've been trying to add an EF Model for my MySQL server but couldn't get a chance as it would either close right before choosing the Entity Framework version for my project or give "Your project references the latest version of Entity Framework, howerver, an entity database provider compatible with this version could not be found for your data connection" error and I'm unable to choose the EF 6.x for it. 我一直在尝试为我的MySQL服务器添加一个EF模型但是没有机会,因为它会在为我的项目选择实体框架版本之前关闭,或者给出“您的项目引用最新版本的实体框架,howerver” ,找不到与此版本兼容的实体数据库提供程序,因为您的数据连接“错误,我无法为其选择EF 6.x.

Versions: Entity Framework 6.2.0, Mysql.Data 8.11.00, Mysql.Data.Entity 6.10.7.0, Connector/Net 8.11.0.0 版本:Entity Framework 6.2.0,Mysql.Data 8.11.00,Mysql.Data.Entity 6.10.7.0,Connector / Net 8.11.0.0

Here's a gif for the first incident. 这是第一次事件的GIF。

Here's a screenshot for the second incident. 这是第二次事件的屏幕截图。

So far I've tried: 到目前为止,我已经尝试过:

  1. Installed Mysql.Data.Entity from NuGet Package Manager and edited the app.config file according to this guide. 从NuGet Package Manager安装了Mysql.Data.Entity,并根据指南编辑了app.config文件。
  2. Installed lower versions of Entity Framework and that wouldn't cause an error and I would be able to choose EF 5.x and then the window would close immediately. 安装较低版本的Entity Framework并且不会导致错误,我可以选择EF 5.x然后窗口会立即关闭。
  3. Added the Mysql.Data, Mysql.Data.EntityFramework references directly from the Connector's directory. 直接从Connector的目录添加了Mysql.Data,Mysql.Data.EntityFramework引用。
  4. Installed EF 6 first, Mysql.Data.Entity second or the other way around. 首先安装EF 6,Mysql.Data.Entity安装第二个或其他方式。

Unfortunately, none of these worked. 不幸的是,这些都没有奏效。 I've been told that there was a bug related to this exact error before but they said it's been fixed after the update and I'd be able to use it bug-free if I install the packages from NuGet. 我被告知之前有一个与此确切错误相关的错误,但是他们说在更新后它已被修复,如果我从NuGet安装软件包,我就可以使用它。 I don't know if it's a bug though. 我不知道这是不是一个bug。 Thanks in advance. 提前致谢。

Make sure following applications are installed. 确保安装了以下应用程序。

  1. MySQL Connector for .NET Download (might require c++ runtime >=2015, check the mysql site) MySQL Connector for .NET 下载 (可能需要c ++运行时> = 2015,检查mysql站点)
  2. MySQL for visual studio Download MySQL for visual studio 下载

You can mange your MySQL products using MySQL for windows Download 您可以使用MySQL for windows Download管理您的MySQL产品

I haven't tried with the new 8.0 connectors but can confirm the 6.10.xx versions had some Nuget package errors on some PC. 我没有尝试使用新的8.0连接器,但可以确认6.10.xx版本在某些PC上有一些Nuget包错误。 (Would complain about missing runtime dlls.. 6.9.11 would work perfectly) (会抱怨缺少运行时dll .. 6.9.11会完美运行)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM