Referenced MySQL.Data.dll is not being loaded properly

Bug reports.
kmck
Certified Professional
Certified Professional
Posts: 83
Joined: Fri Jul 12, 2013 2:41 pm

Referenced MySQL.Data.dll is not being loaded properly

Post by kmck » Mon Mar 03, 2014 3:48 pm

Hello,

I have a custom .dll I use in most of my tests, and that custom .dll references and uses the MySQL.Data.dll. I noticed that when I ran the test on a different system, I got the following error:

Code: Select all

Could not load file or assembly 'MySql.Data, Version=5.2.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified. 
I then added the MySQL.Data.dll reference to my test (in addition to my custom .dll that references MySQL.Data.dll), yet still received the same error when ran on a separate machine.

I then noticed that MySQL.Data.dll was not being copied into the bin/debug folder. Once I copied it into that folder, the test ran just fine.

I may be wrong, but should I not have to re-add MySQL.Data.dll to my test references if a referenced .dll references MySQL.Data.dll in itself? Also, when explicitly adding the dll reference, should it not copy that into the bin/debug folder, or at least be able to reference it properly from GAC?

Any insight into why this error would occur would be greatly appreciated!

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Referenced MySQL.Data.dll is not being loaded properly

Post by Support Team » Tue Mar 04, 2014 3:51 pm

Hi kmck,

Please make sure that the property "Local Copy" is set to true in the "Properties" dialog of the reference.
To get the properties dialog make a right click on the reference and select the Properties option in the context menu.

Regards,
Bernhard

kmck
Certified Professional
Certified Professional
Posts: 83
Joined: Fri Jul 12, 2013 2:41 pm

Re: Referenced MySQL.Data.dll is not being loaded properly

Post by kmck » Mon Mar 10, 2014 3:22 pm

That did it! Sometimes it's the simplest things. Thank you.

jdorfsman
Posts: 1
Joined: Tue Jun 10, 2014 4:52 pm

Re: Referenced MySQL.Data.dll is not being loaded properly

Post by jdorfsman » Tue Jun 10, 2014 4:56 pm

Hi! I have my reference set to local and I am still getting that error..
I tried to add it to the GAC with "gacutil -i ~/Projects/Forums/Dlls/mysql.data.dll"
but got this error: Failure adding assembly /home/jdorfsman/Projects/Forums/Dlls/mysql.data.dll to the cache: the filename "mysql.data.dll" doesn't match the assembly name "MySql.Data"
Any thoughts?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Referenced MySQL.Data.dll is not being loaded properly

Post by Support Team » Mon Jun 16, 2014 3:12 pm

Hi,

Have you already tried to create the DLL with the name "MySql.Data" instead of "mysql.data"?

Regards,
Markus