Search code examples
c#mysql.net-4.0ado.netdbproviderfactories

Cannot load ado.net MySQL


Under C#, framework 4.5. I installed Mysql connector 6.7.4.

If I try to load dynamically the dll with

DbProviderFactory fac = DbProviderFactories.GetFactory("MySql.Data.MySqlClient");

I get : Failed to find or load the registered .Net Framework Data Provider.

  • I added in app.config the mysql (I even can list it with a GetFactoryClasses() !)
  • I tried to put the MySQL assembly in GAC

Nothing works :(


Solution

  • There's a bug with the current provider. I had the same issue. You should use version 6.6.6, it worked for me. Here's a description for the bug register the provider in machine.config