我无法更新edmx,因为实体数据模型设计器无法打开它 [英] I can't update my edmx since the Entity Data Model Designer is unable to open it
问题描述
大家好,谢谢您抽出宝贵的时间来回答我的问题.
Hi everyone and thanks for taking the time to see my question.
我正在使用Entity Framework 6和asp.net MVC运行VS 2017,并且必须向我的实体之一添加一些字段.
I'm running VS 2017 with Entity Framework 6 and asp.net MVC and have to add some field to one of my Entities.
我在数据库中添加了相应的字段,但是当我打开edmx文件时,什么都没有分开显示消息实体数据模型设计器无法打开此文件".它建议我在XML编辑器中打开它,但是右键单击XML文件时没有从数据库更新模型"选项.
I added the corresponding fields in the database, but when I open the edmx file nothing shows apart the message "Entity Data Model Designer is unable to open this file." and it proposes me to open it in XML editor, but I have not the "Update model from Database" option when right clicking on the XML file.
有人知道是什么原因吗?
Is anyone knows what causes this ?
推荐答案
我终于遇到了我的问题.我搜索了大约5个小时的时间来建立新的数据库连接,并意识到我无法与MySQL连接.所以我找到了该线程,它使我进入了好的道路.之后,我发现这因为我无法安装MySQL for Visual工作室.我遵循了以下两个步骤:
I finally came accross my problem. I searched for like 5 hours how to make a new database connection and realised I had no option with MySQL connection. So I found this thread and it led me on the good path. After, I found this cause I weren't able to install MySQL for Visual Studio. I followed these two steps:
-
在没有MySQL安装程序的情况下下载并安装MySQL for Visual Studio组件这里
- 下载并安装"Connector/NET" V6.9.10. "mysql-connector-net-6.9.10.msi" 此处
此后,我启动了Visual Studio,并且Design Surface展示得很好,并且我能够直接从Database:D
After that I started Visual Studio and the Design Surface showed up well, and I was directly able to Update my model from the Database :D
编辑:我刚刚看到Visual Studio的MySQL安装不正确.实际上,它会在安装结束时回滚,并且在新数据库连接"窗口上没有Mysql Database选项:/有人知道这是什么吗?
I just saw that MySQL for visual studio wasn't installed properly. In fact, it rolls back up at the end of the installation, and I have no Mysql Database option on the "new Database connection" window :/ Does somebody know what this is about ?
编辑解决方案,结果证明我将Visual Studio安装在C:以外的其他磁盘上,而Visual Studio Installer的mysql不满意.现在,在添加新连接时,列表中会显示"MySql数据库".
EDIT SOLUTION Turns out that I had installed Visual Studio on an other disk than C: and mysql for visual studio Installer didn't like that. Now I see "MySql Database" in the list when adding a new connection.
这篇关于我无法更新edmx,因为实体数据模型设计器无法打开它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!