我做了什么:
- 使用具有所有权限的用户创建mysql数据库
- 安装 mysql 的 Visual Studio 2012 插件
- 为 mysql 安装 ADO.NET 连接器
- 在 Visual Studio 2012 中创建控制台应用程序项目 (.NET 4.0) 4.1 -> 引用mysql.data和mysql.data.entity
- 创建新的 ADO.Net 实体数据模型
- 选择“从数据库生成”并填写连接属性 (EF 5)
- 选择表/ View
- 完成
现在,VS2012生成了edmx文件,但不生成图表。当我检查实体时,我发现它甚至没有将表/ View 创建为实体。
我在这个设置中遗漏了什么吗?
更新 这是我的 .edmx.diagram
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2008/10/edmx">
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
<edmx:Designer xmlns="http://schemas.microsoft.com/ado/2008/10/edmx">
<!-- Diagram content (shape and connector positions) -->
<edmx:Diagrams>
<Diagram DiagramId="7c3c63f951954ff88783612f28edb5f2" Name="Diagram1" />
</edmx:Diagrams>
</edmx:Designer>
</edmx:Edmx>
最佳答案
我发现了这个问题。实体模型设计器中存在一个错误,现已修复。
This reference should provides details, but I can't find the fix yet.
关于c# - 为什么 Visual Studio 2012 不从我的 MySql 数据库生成 EDM 图表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21049201/