While I was upgrading .Net Framework in our IIS server which was connected to MySQL Database, I started getting an issue:
“Unable to find the requested .Net Framework Data Provider. It may not be installed.”
Solution:
- Open web.config file of your webpage and add following code in it:
<system.data> <DbProviderFactories> <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.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </DbProviderFactories> </system.data>
Note: In code, please update the version of MySQL as per your setting. In my one MySQL connector Net was 6.4.4
- In many blogs and forums, I saw that you have to add MySQL.Data.dll, MySQL.Web.dll, MySQL.Data.Entity.dll files in the bin folder of your webpage too. But in my case , it was not needed. However, my suggestion is to get the .dll file from the respective folder of MySQL. You can get it from :
C:\Program Files (x86)\MySQL\MySQL Connector Net 6.4.4\Assemblies\v2.0
Then, simply restart your IIS service and try to run it. It should work like a charm.
Cheers,
Udhyan.