Share via


Cannot obtain provider factory for MySql.Data.MySqlClient

Question

Tuesday, November 1, 2016 8:03 PM

Hello All,

I have been developing MySQL-based applications in Visual Studio for some time now, and until today without problems.

Today I decided to use MySQL installer to install an update for MySQL Workbench, MySQL for Visual Studio (1.2.6) and Connector/NET (6.9.9), which apparently was a dumb thing to do, because now I get the message 'Cannot obtain provider factory for MySql.Data.MySqlClient' when I try to drop a table from Data Connections on the Dataset Designer.

Not one of my previously developed applications is working anymore, presumably because the directory that MySQL.Data refers to (C:\Program Files (x86)\MySQL\MySQL Connector Net 6.8.3\Assemblies\v4.5\MySql.Data.dll) is not there anymore. I wrote a small test program to see if the database can be accessed through the 'code behind' with the new dll (located at c:\Program Files (x86)\MySQL\Connector.NET 6.9\Assemblies\v4.5\MySql.Data.dll). Since that is still possible, I am guessing that the new connector isn't the problem, but I am at a loss as to why the 'drag and drop' of tables to the Dataset Designer is not working anymore.

I have been looking for solutions on the net and elsewhere, but without luck so far. Can anyone please help me to fix this problem (preferrably without re-installing Visual Studio :) )

Thanks in advance,

jimdoe

- Microsoft Visual Studio Professional 2013 with MySQL for Visual Studio 1.26 installed

- A reference to MySql.Data was added (refers to: c:\Program Files (x86)\MySQL\Connector.NET 6.9\Assemblies\v4.5\MySql.Data.dll)

All replies (2)

Wednesday, November 2, 2016 2:12 AM âś…Answered

Update: I reluctantly decided to delete the current install, and to re-install VS, MySQL for Visual Studio and  Connector/NET 6.9.9.

The 'Cannot obtain ...' message was gone, but now VS complained that I 'already have a connection' when tables are dropped on the designer. It turned out (Google) that I had to install Connector/NET 6.9.8 instead of 6.9.9.

That did the trick. So far, everything works as before. Case closed. Hope this helps someone who runs into the same problems as I have.

jimdoe

 


Thursday, November 3, 2016 2:58 AM

Hi jimdoe,

Glad to know that you have resolved this issue, and thanks for sharing your solution here. Would you please mark your reply as the answer? So it would be helpful for other members who meet the same issue as yours.

Have a nice day.

Sincerely,

Oscar

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].