Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在OSX上的调试目录中运行Xamarin Studio创建的exe文件?_C#_Macos_Xamarin_Mono - Fatal编程技术网

C# 如何在OSX上的调试目录中运行Xamarin Studio创建的exe文件?

C# 如何在OSX上的调试目录中运行Xamarin Studio创建的exe文件?,c#,macos,xamarin,mono,C#,Macos,Xamarin,Mono,我用C#学习了一段时间Xamarin Studio。我感到困惑,因为我无法通过命令“mono test.ext”运行调试目录中的exe文件。以下是错误消息: System.TypeInitializationException: An exception was thrown by the type initializer for Gtk.Container ---> System.DllNotFoundException: gtksharpglue-2 at (wrapper manag

我用C#学习了一段时间Xamarin Studio。我感到困惑,因为我无法通过命令“mono test.ext”运行调试目录中的exe文件。以下是错误消息:

System.TypeInitializationException: An exception was thrown by the
type initializer for Gtk.Container ---> System.DllNotFoundException:
gtksharpglue-2
at (wrapper managed-to-native) 
Gtk.Container:gtksharp_gtk_container_get_focus_child_offset ()
at Gtk.Container..cctor () [0x00000] in <filename unknown>:0 
--- End of inner exception stack trace ---
at Gtk.Bin..ctor (IntPtr raw) [0x00000] in <filename unknown>:0 
at Gtk.Window..ctor (WindowType type) [0x00000] in <filename unknown>:0 
at MainWindow..ctor () [0x00000] in <filename unknown>:0 
at BuildBoxTool.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Gtk.Container ---> System.DllNotFoundException: gtksharpglue-2
at (wrapper managed-to-native) Gtk.Container:gtksharp_gtk_container_get_focus_child_offset ()
at Gtk.Container..cctor () [0x00000] in <filename unknown>:0 
--- End of inner exception stack trace ---
at Gtk.Bin..ctor (IntPtr raw) [0x00000] in <filename unknown>:0 
at Gtk.Window..ctor (WindowType type) [0x00000] in <filename unknown>:0 
at MainWindow..ctor () [0x00000] in <filename unknown>:0 
at BuildBoxTool.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0 
System.TypeInitializationException:异常由
Gtk.Container的类型初始值设定项-->System.DllNotFoundException:
gtksharpglue-2
at(包装器管理为本机)
Gtk.Container:gtksharp\u Gtk\u Container\u get\u focus\u child\u offset()
在Gtk.Container..cctor()[0x00000]中:0
---内部异常堆栈跟踪的结束---
在Gtk.Bin..ctor(IntPtr原始)[0x00000]英寸:0
在Gtk.Window..ctor(WindowType类型)[0x00000]中:0
在主窗口中..ctor()[0x00000]位于:0
在0中的BuildBoxTool.MainClass.Main(System.String[]args)[0x00000]处
[错误]致命的未处理异常:System.TypeInitializationException:Gtk.Container的类型初始值设定项引发了异常-->System.DllNotFoundException:gtksharpglue-2
at(包装器管理为本机)Gtk.Container:gtksharp\u Gtk\u Container\u get\u focus\u child\u offset()
在Gtk.Container..cctor()[0x00000]中:0
---内部异常堆栈跟踪的结束---
在Gtk.Bin..ctor(IntPtr原始)[0x00000]英寸:0
在Gtk.Window..ctor(WindowType类型)[0x00000]中:0
在主窗口中..ctor()[0x00000]位于:0
在0中的BuildBoxTool.MainClass.Main(System.String[]args)[0x00000]处
我该怎么解决呢?谢谢~

System.TypeInitializationException:异常由 Gtk.Container的类型初始值设定项-->System.DllNotFoundException: gtksharpglue-2

默认情况下,Mono lib目录不会添加到任何全局dyld路径,有关详细信息,请查看dyld的手册页:

曼迪尔德

~~~
       DYLD_FALLBACK_LIBRARY_PATH
              This is a colon  separated  list  of  directories  that  contain
              libraries.  It is used as the default location for libraries not
              found  in  their  install  path.   By  default,  it  is  set  to
              $(HOME)/lib:/usr/local/lib:/lib:/usr/lib.
~~~
因此,要运行基于GTK的“test.exe”,请执行以下操作:

export DYLD_FALLBACK_LIBRARY_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib:/usr/local/lib:/usr/lib"
mono test.exe

非常感谢你。你的意思是我应该使用命令“DYLD\u FALLBACK\u LIBRARY\u PATH=“/LIBRARY/Frameworks/Mono.framework/Versions/Current/lib:/usr/local/lib:/usr/lib”Mono test.exe”运行应用程序吗。这不起作用。请将env var DYLD_FALLBACK_LIBRARY_路径设置为Mono lib安装的位置,假设您没有在OS-X上运行并行Mono安装,该安装将是“/LIBRARY/Frameworks/Mono.framework/Versions/Current/lib”,然后是“Mono yourexenamehere.exe”