Could not connect to MySQL through EF6 in Visual Studio 2013

This worked for me WITHOUT reinstalling the Visual Studio or anything what so ever.

  • installed latest MySQL visual studio plugin and MySQL connector net
  • removed the entityFramework Tag in App.config or Web.config and all its child tags.
  • replaced it with the following code:

<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" /> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework>


I resolved the same way as above.

My step for example:

  • Install latest EntityFramework using NuGet
  • Install latest MySql.Data.Entity

  • Add reference all the 4 files in C:\Program Files (x86)\MySQL\MySQL Connector Net 6.8.3\Assemblies\v4.5

  • Replace the entityFramework in Web.config as below:

    <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" /> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework>