这是我遇到的问题:我使用 MonoDevelop 编写了一个 Gtk# 程序,它运行良好。但现在我希望能够在其他 Linux 机器上运行它而无需安装 MonoDevelop。
我的解决方案有两个项目:主 Gtk# 应用程序和它所依赖的 C# 库项目。因此,当我构建主项目时,它会生成 MainProject.exe 和 MainProject.exe.mdb,以及 bin/Release 文件夹中的 DependencyProject.dll。
我尝试运行以下命令将其全部打包到一个可执行文件中(从 bin/Release 文件夹运行):
mkbundle MainProject.exe -o mainproject --deps *.dll
但是,我从运行该命令得到这个错误:
未处理的异常:
System.IO.FileNotFoundException:无法加载文件或程序集“gtk-sharp”或其依赖项之一。该系统找不到指定的文件。
文件名:'gtk-sharp'
在 System.AppDomain.Load (System.String assemblyString, System.Security.Policy.Evidence assemblySecurity, Boolean refonly) [0x00000] in :0
在 (wrapper remoting-invoke-with-check) System.AppDomain:Load (string,System.Security.Policy.Evidence,bool)
在 System.Reflection.Assembly.ReflectionOnlyLoad (System.String assemblyString) [0x00000] in :0
在 IKVM.Reflection.Universe.DefaultResolver (System.String refname, Boolean throwOnError) [0x00000] in :0
在 IKVM.Reflection.Universe.Load (System.String refname, IKVM.Reflection.Module requestingModule, Boolean throwOnError) [0x00000] in :0
在 IKVM.Reflection.Universe.Load (System.String refname) [0x00000] in :0
在 MakeBundle.QueueAssembly(System.Collections.Generic.List`1 文件,System.String 代码库)[0x00000] 中:0
[错误] 致命的未处理异常:System.IO.FileNotFoundException:无法加载文件或程序集“gtk-sharp”或其依赖项之一。该系统找不到指定的文件。
文件名:'gtk-sharp'
在 System.AppDomain.Load (System.String assemblyString, System.Security.Policy.Evidence assemblySecurity, Boolean refonly) [0x00000] in :0
在 (wrapper remoting-invoke-with-check) System.AppDomain:Load (string,System.Security.Policy.Evidence,bool)
在 System.Reflection.Assembly.ReflectionOnlyLoad (System.String assemblyString) [0x00000] in :0
在 IKVM.Reflection.Universe.DefaultResolver (System.String refname, Boolean throwOnError) [0x00000] in :0
在 IKVM.Reflection.Universe.Load (System.String refname, IKVM.Reflection.Module requestingModule, Boolean throwOnError) [0x00000] in :0
在 IKVM.Reflection.Universe.Load (System.String refname) [0x00000] in :0
在 MakeBundle.QueueAssembly(System.Collections.Generic.List`1 文件,System.String 代码库)[0x00000] 中:0
我看到了一些其他类似问题的 Stack Overflow 问题,但没有一个提供任何实用的解决方案。如何mkbundle
有效地使用此命令?