I am attempting to connect to MySQL through a C# .NET web MVC application.
My issue is that, when I attempt to add an ADO.NET Entity Data Model, generated from Database, based on my MySQL connection, I get the following error message:
Your project references the latest version of Entity Framework; however, an Entity Framework database provider compatible with this version could not be found for you data connection. Exit this wizard, install a compatible provider, and rebuild your project before performing this action
I'm running the following software, upgrades & add-ons:
My web.config, entityFramework block:
.. </system.webServer> <entityFramework> <defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" /> <providers> <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" /> </providers> </entityFramework> <runtime> ..
I have looked at all other solutions I could find here on SO and generally through google, tried all of them and none of the solutions seems to have worked or have been for very different versions of Connector/NET or other of the programs needed.
Can anyone spot what I am doing wrong?
Basic solution is to reinstall MySQL and VisualStudio including Entity and .NET.
For some reason, I am not certain why, the installation process corrupts the DLLs, or at least that is the experience I had and other colleagues. Our solution has been to try all of above with to no avail. So in the end we tried to reinstall, and it worked. So try that :)
I had the same issue. After installing:
I didn't want to reinstall Visual Studio, so after some tests, I found that the folder "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies" contained old versions of the following files:
After closing Visual Studio, I replaced these files with those in "C:\Program Files (x86)\MySQL\MySQL Connector Net 6.9.5\Assemblies\v4.5", and now it works!
Note: replace 6.9.5 in the subfolder name above, with the actual version installed in your system.