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

Programming, error messages and sample code > ASP.NET
If you receive the following error when 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 the instruction below to resolve this issue:

1. Add the following into your Web.config:

    <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=, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />

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

    * mysql.web.dll

3. When you publish your webisite , please make sure those dll above are included.  Change those dll to "local copy" before you publish.

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