无法创建实体数据模型 - 使用MySql和EF6 [英] Can't Create Entity Data Model - using MySql and EF6

查看:550
本文介绍了无法创建实体数据模型 - 使用MySql和EF6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Visual Studio 2013中的C#/ Web项目添加一个edmx实体模型。我的问题是该文件未创建。

I'm trying to add an edmx Entity model to my C#/Web Project in Visual Studio 2013. My problem is that the file is not created.

I请执行以下步骤:


  1. 给项目名称

  2. 从数据库中选择EF Designer

  3. 从已经测试成功连接到MySQL数据库的下拉菜单(localhost)选择连接

  4. 将webc.config中的连接设置保存为选项被选中

  5. 我点击下一步,窗口消失,我回到代码窗口

  1. Give the item a name
  2. Choose 'EF Designer from database'
  3. Choose the connection from the drop down (localhost) that already tested successfully connecting to MySQL databse
  4. The "Save connection settings in webc.config as" option is checked
  5. I click 'Next' AND the window disappeared and I get back to the code window

没有edmx文件被创建。(尽管它适用于SQL Server,但不适用于MySQL)

No edmx file is created. (although it works with SQL Server, but not for MySQL)

我有实体框架6.1.2 安装, MySql.Data MySql.Data.Entities MySql.Data.Entity MySql.Web - 全部安装。

I have Entity Framework 6.1.2 installed, MySql.Data, MySql.Data.Entities, MySql.Data.Entity, MySql.Web -- all installed.

在尝试添加实体模型文件之前,我还重新构建了项目。

I also rebuilt the project before trying to add an entity model file.

我已经使用最新的 .NET连接器安装了最新的MySQL包。

I've installed the latest MySQL package with the latest .NET connector.

运行:Windows 7上的Visual Studio 2013。

Running: Visual Studio 2013 on Windows 7.

任何想法如何解决?

Any ideas how to solve this?

推荐答案

我通过以下步骤解决了此问题:

I solved this issue by following some steps below:


    通过使用Package Manager Console中的命令从Nuget中卸载 MySql.Data.Entities
    卸载包MySql .Data.Entities

将项目引用添加到最新的 MySql.Data.Entity.EF6.dll您的MySql连接器安装路径中的 C:\Program Files(x86)\MySQL\MySQL Connector Net 6.9.8\Assemblies\v4.5

Add project reference to the latest MySql.Data.Entity.EF6.dll from your MySql connector installation path at: C:\Program Files (x86)\MySQL\MySQL Connector Net 6.9.8\Assemblies\v4.5

这篇关于无法创建实体数据模型 - 使用MySql和EF6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆