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:
<
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
>
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
* mysql.data.entity.dll
* mysql.data.dll
* mysql.data.cf.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.
Article ID: 256, Created: October 23, 2012 at 9:21 PM, Modified: October 23, 2012 at 9:22 PM