Register entityFramework with MySql.Data 6.7.2.0 connector

Gunnar picture Gunnar · May 27, 2013 · Viewed 7.2k times · Source

I have tried to configure my web project to use MySQL pre release of .net connectors, version 6.7.2.0. However, i keep getting this message, even if I try my best configure my project to use the 6.7.2.0 version of the connectors.

As it is now, I keep getting this errormessage:

No Entity Framework provider found for 'MySql.Data.MySqlClient' ADO.NET provider. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

I have tried different ways to configure my Web.config file, and here is my current settings:

  <system.data>
    <DbProviderFactories>
      <remove invariant="MySql.Data.MySqlClient" />
        <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.7.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>
  <entityFramework>
    <defaultConnectionFactory type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" />
  </entityFramework>

I have installed EF6 alfa3 from NuGet. Currently my connector has been installed manually from this downloaded file, I tried to install it from NuGet repository, but with the exact same result.

Answer

bricelam picture bricelam · Jun 3, 2013

In addition to registering the ADO.NET provider, you need to register the Entity Framework provider:

<entityFramework>
  <providers>
    <provider invariantName="MySql.Data.MySqlClient"
              type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity" />
  </providers>
</entityFramework>

You also need to ensure that the provider has been built against Entity Framework 6. See this article for more information on this.