I downloaded MySQL Connector/Net 6.7.4 and MySQL for Visual Studio 1.0.2, and then followed these instructions to test it:
- Create a connection to the existing MySQL database.
- Create a console application.
- Add the ADO.NET Entity Data Model from the existing database connection.
- Add Code Generation Item EF 5.x DbContext Generator, replacing the .tt files.
- Write some code that retrieved records from the database.
Running the application, I got this exception:
ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.
Then I added references to the MySql.Data
and MySql.Data.Entity
libraries version 6.7.4.0 to my .NET 4.5 project. Now when I run the application, I get a different exception:
FileLoadException: Could not load file or assembly 'MySql.Data, Version=6.6.5.0,culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Note the version number, which is not the version of MySQL Connector that I have installed.
How do I get it working correctly?