首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么mono下linux上的.net程序无法运行?

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

Stack Overflow用户
提问于 2013-02-05 03:03:03
回答 2查看 680关注 0票数 2

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

有人能告诉我为什么吗?

代码语言:javascript
复制
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
EN

回答 2

Stack Overflow用户

发布于 2013-02-07 18:04:09

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

更新(2016):

我最初的答案可能是错的。根据this page的说法,对Windows forms2.0的支持已经完成,但可能还有一些错误,我还没有尝试过。但是,如果您使用第三方UI库,例如Infragistics,它们可能会因为本机调用而无法工作。

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

票数 2
EN

Stack Overflow用户

发布于 2013-11-11 23:50:53

我也有同样的问题(.net,Linux,Mono)。我的程序有一个provider-subsrciber模式。提供程序在另一个线程上。主窗体订阅提供程序。当它被触发时:

代码语言:javascript
复制
    private void RefreshLabels(ParameterMap pm)
    {
        string StateValueKey = string.Empty;
        string svkValue = string.Empty;

        if (InvokeRequired)
        {
            BeginInvoke(new RefreshItemsDelegate(RefreshLabels), new object[] { pm });
        }
        else
        {

.它来自另一个线程,并完成它的工作。

另一个订阅者也在主窗体上触发了一个事件。我忽略了这个事件,问题就消失了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14693643

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档