我正在尝试在我的代码中使用NDesk.Options库。我的计算机上有NDesk.Options.dll文件。我使用
编译我的程序dmcs -R:/path-to-dll/NDesk.Options.dll Program.cs
程序编译正常,没有错误。但是,当我使用mono运行二进制文件时,我得到了这个错误
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'NDesk.Options, Version=0.2.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'NDesk.Options, Version=0.2.1.0, Culture=neutral, PublicKeyToken=null'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'NDesk.Options, Version=0.2.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'NDesk.Options, Version=0.2.1.0, Culture=neutral, PublicKeyToken=null'
库没有依赖关系,dll的路径是正确的。
这是我计算机上的库的pkf-config文件。
prefix=${pcfiledir}/../..
exec_prefix=${pcfiledir}/../..
libdir=${exec_prefix}/lib
assemblies_dir=${libdir}/ndesk-options
Libraries=${assemblies_dir}/NDesk.Options.dll
Sources=${assemblies_dir}/Options.cs
Name: NDesk.Options
Description: C# Program Option Parsing Library.
Version: 0.2.1
Requires:
Libs: -r:NDesk.Options.dll