Can#39;t Create Entity Data Model - using MySql and EF6(无法创建实体数据模型 - 使用 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.
我执行以下步骤:
- 为项目命名
- 选择'EF Designer from database'
- 从下拉列表(本地主机)中选择已成功连接到 MySQL 数据库的连接
- 选中将 webc.config 中的连接设置另存为"选项
- 我点击了下一步",然后窗口消失了,我又回到了代码窗口
没有创建 edmx 文件.(虽然它适用于 SQL Server,但不适用于 MySQL)
No edmx file is created. (although it works with SQL Server, but not for MySQL)
我安装了 Entity Framework 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:
使用包管理器控制台中的以下命令从 Nuget 卸载
MySql.Data.Entities:Uninstall-Package MySql.Data.Entities
从您的 MySql 连接器安装路径中添加对最新 MySql.Data.Entity.EF6.dll 的项目引用:C:\Program Files (x86)\MySQL\MySQL 连接器网络 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法创建实体数据模型 - 使用 MySql 和 EF6
基础教程推荐
- 从字符串 TSQL 中获取数字 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
