1

我为 '.NET & Mono' 获取了mysql-connector-net-6.5.4-noinstall.zip 。我在 MSVS 中使用它并没有问题。尝试使用 mono 2.10 在 linux 上运行二进制文件时,我收到有关 mysql dll 无效的错误。在查看单声道开发时,我实际上可以浏览 DLL。当我尝试构建编译器时,会抛出一个错误,声称名称无效

当运行在 Windows 上构建的二进制文件时,我得到了这个异常

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.
File name: 'MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'

我怎样才能让它工作?注意:我在 3.5 下构建它,而我计划使用的服务器只有 mono 2.6,所以我无法升级到 .NET 4

-编辑-

我检查了服务器所说的内容,我得到了这个异常。请注意 mysql.data.dll 位于同一目录中。

** (MySqlTest.exe:28256): WARNING **: The following assembly referenced from /root/apps/MySqlTest/MySqlTest.exe could not be loaded:
     Assembly:   MySql.Data    (assemblyref_index=2)
     Version:    6.5.4.0
     Public Key: c5687fc88969c44d
The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/root/apps/MySqlTest/).

** (MySqlTest.exe:28256): WARNING **: Could not load file or assembly 'MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.
File name: 'MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'
4

1 回答 1

2

哦^&*(),他们打包错了。他们使用区分大小写的文件名构建 dll,并在压缩之前将 dll 名称小写。重命名MySql.Data.dll解决它。

于 2012-08-01T12:01:17.310 回答