Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am currently getting the following error. On a locahost website.

Could not load file or assembly 'MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Though, the reference is definitely there in the references folder and that dll is definitely on my local machine in the place it is pointing to. I have also tried deleting and re-adding the reference.

Does anyone know what would cause this error?

Also what is the assemblys manifest definition?

Thanks in advance for the help, I very much appreciate it.

like image 418
recneps Avatar asked Dec 26 '22 05:12

recneps


1 Answers

in visual studio select the reference in the solution explorer then in the properties make sure the Specific Version property is set to false.

If you have an entry for this reference in the web.config, edit the file and remove the version information.

if you close visual studio and open the project file with a text editor, make sure in the project file the version of the assembly is not listed but only the name and type, so just remove the following:

, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'

then it should work no matter if you are using the 6.5.5 or 6.5.4, as long as the code is using classes and methods available in both.

like image 135
Davide Piras Avatar answered Dec 28 '22 23:12

Davide Piras