mysql.data.dll error0_MySQL.Data.dll引用错误

bd96500e110b49cbb3cd949968f18be7.png

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[^]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值