BLToolkit-mysql-connector exception: Could not load file or assembly MySql.Data, Version=6.9.7.0

2.7k views Asked by At

I am using BLToolKit (ver. 4.3.2.0) and MySql Connector (BLToolkit.Data.DataProvider.MySql.4 of version 4.3.2.0) from NuGet. When I run my web.app in the mono-environment all work perfectly. But on the IIS I get an exception:

FileLoadException: Could not load file or assembly 'MySql.Data, Version=6.9.7.0, Culture...

What is wrong?

UPD: also I used the MySql.Data (from NuGet), version 6.9.8.0

2

There are 2 answers

5
321polorex123 On

Just a guess: Is the corresponding assembly in the same folder as your program (should be a library file like "MySql.dll" or "MySql.Data.dll")?

EDIT: This problem has been reported previously: Could not load file or assembly 'MySql.Data, Version=6.2.2.0

0
Stef Vercamer On

I had the samen problem and resolved it with a copy of the previous version. - Download the version you need from https://downloads.mysql.com/archives/c-net/ - install the connector on a PC (not the one you are using, it won't install - copy the folder MySQL Connector Net 6.9.5 from C:\Program Files (x86)\MySQL to the same folder on your PC. - In Visual studio: remove the MySQL.Data-reference. - Add the reference again using 'Addreference / Browse' - Choose MySQL.Data.dll in the folder C:\Program Files (x86)\MySQL\MySQL Connector Net version\Assemblies\v4.5