无法加载文件或程序集“MySql.Data,版本= 6.2.2.0加载、版本、文件、程序

由网友(心在遠方)分享简介:我工作的桌面应用程序用C#和数据库的MySQL。当我在我的机器上安装的安装程序,它工作正常,但是当我在其他机器上安装它的给予下列异常时,尝试访问数据库。我使用 MySQL.Data.dll 与MySQL进行通信。无法加载文件或程序集MySql.Data,版本= 6.2.2.0,文化=中性公钥= c5687fc88969...

我工作的桌面应用程序用C#和数据库的MySQL。当我在我的机器上安装的安装程序,它工作正常,但是当我在其他机器上安装它的给予下列异常时,尝试访问数据库。我使用 MySQL.Data.dll 与MySQL进行通信。

  

无法加载文件或程序集MySql.Data,版本= 6.2.2.0,文化=中性公钥= c5687fc88969c44d或它的某一个依赖。该系统找不到指定的文件。

MySql.Data.dll 在present文件在Program Files文件夹项目的文件夹

其实,当我从它的文件夹中的程序运行文件,它运行正常,没有错误,但是当我试图从它在开始菜单快捷方式运行它,它给这个错误。

解决方案

是否在开始菜单中的快捷键设置正确的工作目录? (我怀疑这是最有可能的答案)

是否有不同的/不正确的版本MySql.Data.dll安装在GAC(全局程序集缓存)?我已经看到了在这之前给类似的错误消息。

I am working on Desktop application with c# and Data base MySQL. When I install its installer on my machine it works fine but when I install it on other machine its give following exception when try to access DB. I am using MySQL.Data.dll to communicate with MySQL.

mysql5.7安装及配置教程

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.

and MySql.Data.dll file in present in Project's folder in Program files folder

Actually when I run it from its folder in Program file it run fine with no error but When i try to run it from its shortcut in Start Menu it gives that error.

解决方案

Does the shortcut in the Start Menu set the working directory correctly? (I suspect that this is the most likely answer)

Is there a different/incorrect version of MySql.Data.dll installed in the GAC (Global Assembly Cache)? I've seen this give similar error messages before.

阅读全文

相关推荐

最新文章