Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL with Entity Framework 6

I've been trying to add an EF Model for my MySQL server but couldn't get a chance as it would either close right before choosing the Entity Framework version for my project or give "Your project references the latest version of Entity Framework, howerver, an entity database provider compatible with this version could not be found for your data connection" error and I'm unable to choose the EF 6.x for it.

Versions: Entity Framework 6.2.0, Mysql.Data 8.11.00, Mysql.Data.Entity 6.10.7.0, Connector/Net 8.11.0.0

Here's a gif for the first incident.

Here's a screenshot for the second incident.

So far I've tried:

  1. Installing Mysql.Data.Entity from NuGet Package Manager and editing the app.config file according to this guide.
  2. Installing lower versions of Entity Framework and that wouldn't cause an error and I would be able to choose EF 5.x and then the window would close immediately.
  3. Adding the Mysql.Data, Mysql.Data.EntityFramework references directly from the Connector's directory.
  4. Installing EF 6 first, Mysql.Data.Entity second and vice-versa.

Unfortunately, none of these worked. I've been told that there was a bug related to this exact error before but they said it's been fixed after the update and I'd be able to use it bug-free if I install the packages from NuGet. I don't know if it's a bug though. Thanks in advance.

like image 327
Umit Avatar asked Sep 19 '25 23:09

Umit


1 Answers

Make sure following applications are installed.

  1. MySQL Connector for .NET Download (might require c++ runtime >=2015, check the mysql site)
  2. MySQL for visual studio Download

You can mange your MySQL products using MySQL for windows Download

I haven't tried with the new 8.0 connectors but can confirm the 6.10.xx versions had some Nuget package errors on some PC. (Would complain about missing runtime dlls.. 6.9.11 would work perfectly)

like image 58
Krish Avatar answered Sep 22 '25 13:09

Krish