Conflicting versions of MySql.Data.dll in .Net project not allowing me to change TableAdapters

  • 1K Views
  • Last Post 05 December 2016
  • Topic Is Solved
erportico posted this 05 December 2016

I have a WinForms / .Net 4.0 application in Visual Studio 2015 Update 3. When I try to add, or edit, a TableAdapter in any of my DataSets, I get this error:

MySql Dataset Error Drag

The wizard detected the following problems when configuring the TableAdapter:

Details:

Generated SELECT statement. [A]MySQL.Data.MySqlClient.MySqlConnection cannot be cast to [B]MySQL.Data.MySqlClient.MySqlConnection. Type A originates from 'MySQL.Data Version 6.9.8.0, Culture=neutral,PublicToken=c5687fc88969c44d' in context 'Default' at location 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\MySQL.Data.dll'. Type B originates from 'MySQL.Data, Version 6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' in context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\MySQL.Data\v4.0_6.9.9.0_c5687fc88969c44d\MySQL.Data.dll'.

Obviously it is complaining about two different versions of the MySQL.Data.dll 6.9.8 and 6.9.9. What I don't understand though is why or where is it referencing version 6.9.8.0? If I look at my project's references, it is using MySQL.Data.dll version 6.9.9.0. This is a NuGet package at location:

C:\Users\Fabs-LenovoY70\Source\Workspaces\Tracker\Tracker\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll

I've tried the solution at [A]MySql.Data.MySqlClient.MySqlConnection cannot be cast to [B]MySql.Data.MySqlClient.MySqlConnection but didn't work.

I've searched my entire solution for any references to 6.9.8 and I've found nothing. I've been Googling for a solution for a whole day now and have found nothing that's worked. Any ideas anyone? Thank you...

admin posted this 05 December 2016

The problem is with MySQL Connector / Net. It is using version 6.9.9.0 of the DLL and everything else is using 6.9.8.0 Go to your community installer and uninstall connector / net. Then go to https://downloads.mysql.com/archives/c-net/ and get version 6.9.8 of the connector / net. Install this and everything should be fine. It has worked on my system.

Close