MVC using mysql returns “'MySql.Data.MySqlClient.MySqlClientFactory' does not implement the IServiceProvider interface”

If you are receiving this error while using your MVC with MySQL database:

[ProviderIncompatibleException: The store provider factory type 'MySql.Data.MySqlClient.MySqlClientFactory' does not implement the IServiceProvider interface. Use a store provider that implements this interface.

You can follow this steps to fix the issue:

Add below into your web.config:

<system.data>
<DbProviderFactories>
<clear />
<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.0.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>

Include the MySQL DLLs in your code. Please make sure the following files are in your BIN folder, not GAC:

* mysql.web.dll
* mysql.data.entity.dll
* mysql.data.dll
* mysql.data.cf.dll

Please make sure that DLL above is included. When you publish your website, Change that dll to "local copy" before you publish.

Make sure the DLL version that you're using in your web.config matches the actual version of your DLL. The version we provide in this KB article might not match what you are using.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

SQL server- network related or instance-specific error happened while connection establishing

  Instance-specific or network related error happening while connecting to SQL server   Please...

OleDB connection string examples

OleDB connection string examples MS Access (Jet) "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA...

Do you allow custom COM components?

Do you allow custom COM components? We are not offering to install the custom COM components...

Error when accessing a WCF services

Error when accessing a WCF services Error when accessing a WCF service: "IIS specified...

How to cache static contents to client with UseMaxAge?

You can consider to caches static contents to the client with UseMaxAge if your website has too...