Unable to find the requested .Net Framework Data Provider. It may not be installed

Solution 1:

Try running this to get a list of installed providers, and check yours is there:

// This example assumes a reference to System.Data.Common.
static DataTable GetProviderFactoryClasses()
{
    // Retrieve the installed providers and factories.
    DataTable table = DbProviderFactories.GetFactoryClasses();

    // Display each row and column value.
    foreach (DataRow row in table.Rows)
    {
        foreach (DataColumn column in table.Columns)
        {
            Console.WriteLine(row[column]);
        }
    }
    return table;
}

UPDATE: You need to have the MySQL Provider installed on the target machine, it's called something like "MySQL Connector Net x.x.x" Which you can get from this website

Solution 2:

With our applications (ASP.NET, Test, Windows Service), we've had to add the below to our app.config or web.config files (inside the configuration node) to make this work:

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