这是我遇到的问题:我使用MonoDevelop编写了一个Gtk#程序,运行得非常好。但现在我想在其他Linux系统上运行它,而不必安装MonoDevelop。
我的解决方案有两个项目:主要的Gtk#应用程序和一个C#库项目,它依赖于该项目。因此,当我构建主项目时,它会在bin/Release文件夹中生成MainProject.exe和MainProject.exe.mdb,以及DependencyProject.dll。
我尝试运行以下命令将所有内容打包成单个可执行文件(从bin/Release文件夹中运行):
然而,在运行该命令时,我遇到了以下错误:
未处理的异常: System.IO.FileNotFoundException:无法加载文件或程序集'gtk-sharp'或其依赖项之一。系统找不到指定的文件。 文件名:'gtk-sharp' 在System.AppDomain.Load(System.String assemblyString,System.Security.Policy.Evidence assemblySecurity,Boolean refonly)[0x00000]中:0 在(wrapper remoting-invoke-with-check) System.AppDomain:Load (string,System.Security.Policy.Evidence,bool) 在System.Reflection.Assembly.ReflectionOnlyLoad(System.String assemblyString)[0x00000]中:0 在IKVM.Reflection.Universe.DefaultResolver(System.String refname,Boolean throwOnError)[0x00000]中:0 在IKVM.Reflection.Universe.Load(System.String refname,IKVM.Reflection.Module requestingModule,Boolean throwOnError)[0x00000]中:0 在IKVM.Reflection.Universe.Load(System.String refname)[0x00000]中:0 在MakeBundle.QueueAssembly(System.Collections.Generic.List`1 files,System.String codebase)[0x00000]中:0 [ERROR] FATAL UNHANDLED EXCEPTION:System.IO.FileNotFoundException:无法加载文件或程序集“gtk-sharp”或其依赖项之一。系统找不到指定的文件。 文件名:“gtk-sharp” 在System.AppDomain.Load(System.String assemblyString,System.Security.Policy.Evidence assemblySecurity,Boolean refonly)[0x00000]中:0 在(wrapper remoting-invoke-with-check) System.AppDomain:Load (string,System.Security.Policy.Evidence,bool) 在System.Reflection.Assembly.ReflectionOnlyLoad(System.String assemblyString)[0x00000]中:0 在IKVM.Reflection.Universe.DefaultResolver(System.String refname,Boolean throwOnError)[0x00000]中:0 在IKVM.Reflection.Universe.Load(System.String refname,IKVM.Reflection.Module requestingModule,Boolean throwOnError)[0x00000]中:0 在IKVM.Reflection.Universe.Load(System.String refname)[0x00000]中:0 在MakeBundle.QueueAssembly(System.Collections.Generic.List`1 files,System.String codebase)[0x00000]中:0
我看到了一些其他类似的问题,但没有一个提供实际的解决方案。我如何有效使用这个命令呢?
我的解决方案有两个项目:主要的Gtk#应用程序和一个C#库项目,它依赖于该项目。因此,当我构建主项目时,它会在bin/Release文件夹中生成MainProject.exe和MainProject.exe.mdb,以及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]中:0 在(wrapper remoting-invoke-with-check) System.AppDomain:Load (string,System.Security.Policy.Evidence,bool) 在System.Reflection.Assembly.ReflectionOnlyLoad(System.String assemblyString)[0x00000]中:0 在IKVM.Reflection.Universe.DefaultResolver(System.String refname,Boolean throwOnError)[0x00000]中:0 在IKVM.Reflection.Universe.Load(System.String refname,IKVM.Reflection.Module requestingModule,Boolean throwOnError)[0x00000]中:0 在IKVM.Reflection.Universe.Load(System.String refname)[0x00000]中:0 在MakeBundle.QueueAssembly(System.Collections.Generic.List`1 files,System.String codebase)[0x00000]中:0 [ERROR] FATAL UNHANDLED EXCEPTION:System.IO.FileNotFoundException:无法加载文件或程序集“gtk-sharp”或其依赖项之一。系统找不到指定的文件。 文件名:“gtk-sharp” 在System.AppDomain.Load(System.String assemblyString,System.Security.Policy.Evidence assemblySecurity,Boolean refonly)[0x00000]中:0 在(wrapper remoting-invoke-with-check) System.AppDomain:Load (string,System.Security.Policy.Evidence,bool) 在System.Reflection.Assembly.ReflectionOnlyLoad(System.String assemblyString)[0x00000]中:0 在IKVM.Reflection.Universe.DefaultResolver(System.String refname,Boolean throwOnError)[0x00000]中:0 在IKVM.Reflection.Universe.Load(System.String refname,IKVM.Reflection.Module requestingModule,Boolean throwOnError)[0x00000]中:0 在IKVM.Reflection.Universe.Load(System.String refname)[0x00000]中:0 在MakeBundle.QueueAssembly(System.Collections.Generic.List`1 files,System.String codebase)[0x00000]中:0
我看到了一些其他类似的问题,但没有一个提供实际的解决方案。我如何有效使用这个命令呢?