linux - 为什么mono下linux上的.net程序无法运行?

标签 linux mono delphi-prism oxygene

我在 Linux 上的 Mono 下运行了我的 Delphi-prism (.NET) 程序。它运行了一段时间后崩溃并在终端上显示以下错误消息。但同一个程序在 Windows 7 上运行得非常好

谁能告诉我为什么?

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at System.Windows.Forms.XEventQueue+PaintQueue.Dequeue () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUIX11.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr handle, Int32 wFilterMin, Int32 wFilterMax) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUI.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Application.RunLoop (Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00000] in <filename unknown>:0
  at Millennia.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

最佳答案

看起来您的程序正在使用 Windows 窗体。对 Windows 窗体的支持在单声道中并不是最好的。 Mono 提供了运行时和库,但如果您想制作跨平台程序,您还需要考虑您使用的 UI 库。

更新(2016):

我原来的答案可能是错误的。根据this page ,对Windows Forms 2.0的支持已经完成,但是可能还存在不少bug,我没有尝试过。但是,如果您使用第三方 UI 库(例如 Infragistics),它们可能由于 native 调用而无法工作。

看看this page有关移植 Winforms 应用程序的更多信息,包括可以提供帮助的 MoMA 工具。

关于linux - 为什么mono下linux上的.net程序无法运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14693643/

相关文章:

mono - 在 CentOS 6.3 上安装 Mod_Mono 和 Xsp4

c# - 运行一个 C# 程序以在单声道中启动另一个 C# 程序

delphi - 为什么 Delphi 中可以自赋值?

linux - 在 UNIX 中以相反的顺序获取句子

linux - 从 shell 脚本执行时使用 psql 关闭 postgres 连接

emacs - 如何在 Emacs 中运行 F# interactive (*nix)

.net - 为什么ShowDialog总是返回DialogResult.Cancel?

c# - 当属性不是默认值时,如何使 Delphi Prism 索引属性对 C# 可见

linux - Install4j Linux 安装程序不工作

linux - 关于/proc/$pid/attr的详细信息?