Howto make MySQL & Entity Framework work with your website when your hosting company does not have Connector/Net installed

I installed MySQL’s Connector/Net v6.2 on my dev machine and used the Entity Framework to query a MySQL server without any problems.  Then I uploaded the same code to my hosting company’s server and I kept getting errors telling me “Unable to find the requested .Net Framework Data Provider”.  In order to make it work, I had to do the following:

  1. Uploaded MySql.Data.dll to my bin directory
  2. Uploaded MySql.Data.Entity.dll to my bin directory
  3. Added the following lines to my web.config file:

<?xml version=”1.0″?>
<configuration>

<system.data>

<DbProviderFactories>

<add name=”MySQL Data Provider” invariant=”MySql.Data.MySqlClient” description=”.Net Framework Data Provider for MySQL” type=”MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.2.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d” />

</DbProviderFactories>

</system.data>


</configuration>

I hope this saves someone else some headaches!

Rob