Can't use Entity Framework with MySQL

When I try to use the Entity framework to connect to a MySQL database (using the "CodeFirst from database" option), after clicking the next "Select data connection" button, the Data Entity wizard will close and in Server Explorer, I see that the data connection closes. I followed the steps from the first comment of this question Enable Entity Framework 6 for MySql (C #) in WinForms Microsoft Visual Studio 2013in an MVC project and over a WinForms project, but I can't find the problem in my specific case; any ideas on what i might have done wrong? (When I test the connection it says it was successful, and when I click Recover Data and add a new row, the changes are saved to the server). Doesn't even create a new connection string in the Web.Config or App.Config files.

+3


source to share


1 answer


I found a way to use Entity Framework 6 with MySQL in an MVC 5 project using Visual Studio 2013 Community Edition (Sorry if for an advanced user one of these steps doesn't make sense, but it worked for me). I first installed the latest versions (May 2015) from:

Then I changed the dll files
  - MySql.Data.dll - MySql.Data.Entity.EF6.dll - MySql.Web.dll from C: \ Program Files (x86) \ MySQL \ MySQL Connector Net 6.9.6 \ Assemblies \ v4. 5 in C: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ Common7 \ IDE



Then, after creating the MVC 5 project, with the Package Manager Console, I ran the following commands

  • MySql.Data installation package li>
  • MySql.Data.Entity installation package
  • MySql.Web installation package

I create a project and after build, the connection parameters are added to the Web.Config file. From now on I can use Entity Framework Code First with MySQL database. Hope it works for others!

0


source







All Articles