问题
Hi everyone and thanks for taking the time to see my question.
I'm running VS 2017 with Entity Framework 6 and asp.net MVC and have to add some field to one of my Entities.
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 ?
回答1:
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:
Download and install the MySQL for Visual Studio component without the MySQL installer here
- Download and install the "Connector/NET" V6.9.10. "mysql-connector-net-6.9.10.msi" here
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
EDIT: 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 ?
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.
来源:https://stackoverflow.com/questions/47115135/object-property-has-the-correct-value-but-the-corresponding-field-in-database-is