我正在尝试使用 mkbundle,这样我就可以分发 GTK# 应用程序,而无需用户安装 .NET/Mono 或 GTK#。我已经成功地捆绑了一个使用 winforms 的应用程序,但由于某种原因,当我对 GTK# 应用程序执行相同操作时,它就不起作用了。
这就是我从 cygwin 中得到的:
$ mkbundle --deps a.exe
OS is: Windows
Sources: 1 Auto-dependencies: True
未处理的异常:System.IO.FileNotFoundException:无法加载文件或程序集“gtk-sharp”或其依赖项之一。该系统找不到指定的文件。 文件名: System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x00000] 处
的 'gtk-sharp'在 (wrapper remoting-invoke-with-check) System. AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence) at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in :0 at (wrapper remoting-invoke-with-check) System .AppDomain:Load (System.Reflection.AssemblyName) 在 System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in :0
在 MakeBundle.QueueAssembly(System.Collections.ArrayList 文件,System.String 代码库)[0x00000] 在:0
在 MakeBundle.Main(System.String[] args)[0x00000] 在:0
[错误] 致命的未处理异常:系统。 IO.FileNotFoundException:无法加载文件或程序集“gtk-sharp”或其依赖项之一。该系统找不到指定的文件。 文件名: System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x00000] 处
的 'gtk-sharp'在 (wrapper remoting-invoke-with-check) System. AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence) 在 System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in :0
在 (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName)
at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in :0
at MakeBundle.QueueAssembly ( System.Collections.ArrayList 文件,System.String 代码库)[0x00000] in :0
at MakeBundle.Main (System.String[] args) [0x00000] in :0`
但是我的 PATH 变量中有 /cygdrive/c/GtkSharp/2.12/lib 。我可以检查一下,就好像我在 cygwin 中输入“gtk-sharp.dll”一样,我得到以下返回:
$ gtk-sharp.dll
bash: /cygdrive/c/GtkSharp/2.12/lib/gtk-sharp-2.0/gtk-sharp.dll: cannot execute binary file
所以它应该能够找到文件!
任何帮助将非常感激。