"Failed to find or load the registered .Net Framework Data Provider" with MySQL + ASP.NET

10,282

Solution 1

If the assembly in question is not in the GAC, then it does have to exist in the path, i.e. the bin folder. The be in the GAC, the assembly has to be signed. I'm guessing the the builders of MySql.data.dll did not sign the dll so you may not be able to put it into the GAC on the server. So copying the dll is your solution.

Solution 2

Another reason for this error was noted by a user on a similar thread here I have copy pasted the users answer below in case the link changes

I just saw that the reason of this exception in my case were the differt versions between dll and the configuration entry. So, sometimes the dll you actually have (either installed by nuget or other way) differs from the entry in the node of the app.config. This section, if not in app.config, can be also found under Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config and nearby folders. Changing version in the entry to version of the dll solved the issue.

Share:
10,282
Malachi
Author by

Malachi

I code and stuff

Updated on June 12, 2022

Comments

  • Malachi
    Malachi almost 2 years

    How do we repair this? This question has been sort of addressed many times around the internet, but it's always a workaround. Always copying the MySql.data.dll into your bin directory, or explicitly stating what version you want. What is the "proper" approach to using DbProvderFactory for MySQL with ASP.NET?

    I'd like to be able to develop locally and not worry what version they have installed on the server. As it stands, if I do copy up my own version I have to make sure it's the one they use. Seems easy to break.