C#应用程序在monomac& xcode没有在带有单声道框架的窗口上执行

时间:2015-02-10 14:58:38

标签: c# xcode windows mono

我开发了一个简单的应用程序,在Mac中使用带有按钮的窗口,使用xamarine studio和xcode。我编译并创建了HelloMonoMac.exe

我在Windows机器上安装了mono框架并打开了mono命令提示符

mono HelloMonoMac.exe

它出现以下错误

System.TypeInitializationException: An exception was thrown by the type initializer for MonoMac.AppKit.NSApplication ---> System.TypeInitializationException: An exception
 was thrown by the type initializer for MonoMac.ObjCRuntime.Selector ---> 

System.DllNotFoundException: /usr/lib/libobjc.dylib
  at (wrapper managed-to-native) MonoMac.ObjCRuntime.Selector:GetHandle (string)
  at MonoMac.ObjCRuntime.Selector..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at MonoMac.AppKit.NSApplication..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at HelloMonoMac.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 MonoMac.AppKit.NSApplication ---> System.TypeIn
itializationException: An exception was thrown by the type initializer for MonoMac.ObjCRuntime.Selector ---> System.DllNotFoundException: /usr/lib/libobjc.dylib
  at (wrapper managed-to-native) MonoMac.ObjCRuntime.Selector:GetHandle (string)
  at MonoMac.ObjCRuntime.Selector..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at MonoMac.AppKit.NSApplication..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at HelloMonoMac.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0

我还将MonoMac.dll复制到.exe所在的文件夹中。

是否可以使用xcode在单声道中开发一些应用程序并在Windows上运行?

1 个答案:

答案 0 :(得分:0)

我有同样的问题,请检查一下: mono project