Hello all,
I am having a problem with a class library project where a MySql dll is referenced. I am using this class library to make CRUD operations in my projects to avoid rewriting the same code over and over again. In class library projects I have utility class where I can log errors, conenct to Oracle, mySQL and MSSQL databases and do some stuff.
I have built this class library let's say X.dll(the project builds without errors) and add this X.dll reference in another project (Assume Project A) in order to do some CRUD operations. It seems like the code for Oracle, MSSQL and logging works and I can even step into referenced dll code from my Project A and debug the code from there. But when I try to some processing by using the mySQL class that I have written in class library project doesn't allow me to step into the code, totally ignores and throws an exception. The exception details are;Could not load file or assembly 'MySql.Data, Version=6.7.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)
I have checked the MySql.Data dll properties and its version is 6.7.4.0 and it is referenced correctly in the project and I also placed the MySql.Data.dll file to my bin folder. I also tried installing MySql dll by using NuGet and still I have the sam error.
I have also added the following code to config file but still no good.
Btw, my class library and my Project A are both in Framework 4.0.
If some have any other recommendations I will be more than happy to hear about it! Thanks in advance.
解决方案Download[^] and install MySQL connector (ADO.NET Driver for MySQL (Connector/NET)). If it won't help, please let me know.
Other data providers: ADO.NET Data Providers[^]