As of today weI can connect to a MySQL database, but cannot generate the Entity Data Model from a MySQL database in Visual Studio 2017
To access a MySQL database from Visual Studio 2017
IMPORTANT: First install MySQL for Visual Studio, and after that install MySQL Connector/Net.
If MySQL Connector/Net is already installed on your workstation, uninstall it before installing MySQL for Visual Studio and reinstall MySQL Connector/Net.
Install MySQL for Visual Studio
Available version information is at https://dev.mysql.com/doc/visual-studio/en/visual-studio-intro.html
- Close all instances of Visual Studio,
- Download the installer from https://dev.mysql.com/downloads/windows/visualstudio/
- Start the installer
- Click the Complete button,
- If you select Typical, make sure the Visual Studio 2017 components are selected
Install the MySql Connector/Net the fully-managed ADO.NET driver for MySQL
- Download the installer from https://dev.mysql.com/downloads/connector/net/
- Download version 6.9.10, because version 6.10.5 throws the
Inheritance security rules violated by type: ‘MySql.Data.Entity.MySqlEFConfiguration’. Derived types must either match the security accessibility of the base type or be less accessible
error. More info at https://stackoverflow.com/questions/47227495/inheritance-security-rules-violated-by-type-mysql-data-entity-mysqlefconfigura
- Select version 6.9.10, your operating system and click the Download button
- If you don’t want to create an Oracle account, click the No thanks… link
- Start the downloaded installer
- Click the Complete button
Install the NuGet packages
Make sure to install the same version of the NuGet packages as the MySql Connector/Net
Thank you very much. Only your post help me to connect to MySQL data base using Entity Framework. The trick is version Connector C# and MySQL.Data.Entity6 shuld be the SAAAAAAAME. For me version of Connector and Nuget Package MySQL.Data.Entity6 – 6.9.12 have worked
Thanks to your usefull article, I fillanly was able to connect to MySQL database with Entity Framework.
If I had not found this article, I would have gave up using MySQL database with Entity Framework.
Again, I really appreciate you!
Thanks! It’s work! :)
I have done all you described above but i got an error continuously as below:
Could not get column information for database object named