使用C#connect Mysql:无法加载文件或程序集 [英] use C# connect Mysql : Could not load file or assembly

查看:80
本文介绍了使用C#connect Mysql:无法加载文件或程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法加载文件或程序集``MySql.Data,Version = 6.2.2.0,Culture = neutral,PublicKeyToken = c5687fc88969c44d''或其依赖项之一.系统找不到指定的文件.

如何解决?

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

How to fix it ?

推荐答案

在PC上安装MySql.不要忘记MySql Connector DLL!

请参见此处 [
Install MySql on the PC. Don''t forget the MySql Connector DLL!

See here[^]


检查MySQL是否安装了正确的版本.
参考:
http://stackoverflow.com/questions/2041051/could-not-load-file-or-assembly-mysql-data-version-6-2-2-0 [
Check if there is proper version on MySQL installed.
Ref:http://stackoverflow.com/questions/2041051/could-not-load-file-or-assembly-mysql-data-version-6-2-2-0[^]


为DotNet安装最后一个mySql连接器.

下载MySql Connector 6.3

生成项目时,请确保将连接器dll复制到输出目录中.
(在解决方案资源管理器中,打开引用"树.
选择mysql dll,然后用鼠标左键选择属性.
在属性中,将本地复制"设置为True).

就是这样:)
Install the last mySql Connector for DotNet.

Download MySql Connector 6.3

When build the project make sure that the connector dlls are copied in the output directory.
(In the solution explorer, open References tree.
select the mysql dll and with the left mouse button select property.
In the Property set the "Copy locally" filed on True )

That''s all :)


这篇关于使用C#connect Mysql:无法加载文件或程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆