Mysql – could not load file or assembly ‘thesql.data, version=6.9.5.0

dllMySQLnetvb.net

I'm having a issue with a Visual Basic 2013 program I made (in vb.net) and the issue is with MySQL.data.dll, I've tried changing copy local to true in the GAC, I've tried upgrading my MySQL.data.dll to the most recent version but whatever I do it only works if the MySQL.data.dll folder is in the same folder as the executable when running it.

(Do note that this error only occurs on other machines, not my machine)

This is the error exactly:

[Could not load file or assembly 'MySql.data, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.]

Please help, I don't want to have my users have to put MySQL.data.dll in a file with the exe just to be able to run it (for obvious reasons.)

Best Answer

Check the version of the MySQL assembly against the versions appearing in the compiler output.

Do not use the error list look at the Output window and select Build from the drop down and look for errors.

The most probable cause is your application is linked to specific (possibly multiple) versions of MySQL, and there is a conflict on the specific version of MySQL referenced. You might also want to change the specific version property of the assembly reference...

How exactly does the "Specific Version" property of an assembly reference work in Visual Studio?

asp server error ' Could not load file or assembly ' but the assembly is definitely there.

It's pretty simple. You need to make sure the reference to the assembly is correct. I'd avoid installing MySQL into the GAC. Don't install the MSI, if you have uninstall it, then download the zip archive

mysql-connector-net-6.9.5-noinstall.zip

Extract the files to a folder reference those assemblies in your solution. If you're using source control check the folder containing the MySQL assemblies into source control, with the rest of the solution.

If you have more than one assembly referencing MySQL you should check that they are all referencing the same version, from the same location and/or have the "Specific Version" property set to false and "Copy Local" set to true.