Armv7 Debian 9版本上的Mono libgdiplus崩溃

时间:2019-02-18 17:51:41

标签: c# winforms mono debian armv7

我在使用Armv7在Debian 9,Kernel 4.9上运行以Mono版本4.6.2(来自apt)运行winforms应用程序时遇到很多麻烦。我也尝试使用Mono install guide中的Mono 5.18,但是遇到了同样的错误。该项目以前在带有3.0内核的Debian 7上运行,并且运行良好。

每当我尝试运行我的应用程序时,都会看到以下错误:

  

未处理的异常:       System.ArgumentException:引用为空或无效值[GDI +状态:InvalidParameter]         在<1917aa1c39d94b1a91807b8cd9f03350>:0中的System.Drawing.GDIPlus.CheckStatus(System.Drawing.Status状态)[0x0009b]处         在System.Drawing.Bitmap..ctor(System.Int32宽度,System.Int32高度,System.Drawing.Imaging.PixelFormat格式)[0x00017]中   <1917aa1c39d94b1a91807b8cd9f03350>:0         在System.Drawing.Bitmap..ctor(System.Drawing.Image原始,System.Int32宽度,System.Int32高度)处位于[0x00000]   <1917aa1c39d94b1a91807b8cd9f03350>:0         在System.Drawing.Bitmap..ctor中(System.Drawing.Image原始,System.Drawing.Size newSize)在[0x00010]中   <1917aa1c39d94b1a91807b8cd9f03350>:0         在(包装器远程调用检查)System.Drawing.Bitmap:.ctor(System.Drawing.Image,System.Drawing.Size)         在System.Windows.Forms.XplatUIX11.DefineCursor(System.Drawing.Bitmap位图,System.Drawing.Bitmap蒙版,   System.Drawing.Color cursor_pixel,System.Drawing.Color mask_pixel,   System.Int32 xHotSpot,System.Int32 yHotSpot)[0x0004e]在   0:         在System.Windows.Forms.XplatUI.DefineCursor(System.Drawing.Bitmap位图,System.Drawing.Bitmap蒙版,   System.Drawing.Color cursor_pixel,System.Drawing.Color mask_pixel,   System.Int32 xHotSpot,System.Int32 yHotSpot)[0x00000]在   0:         在System.Windows.Forms.Cursor.CreateCursor(System.IO.Stream流)[0x00058]中的位置:: 0         在System.Windows.Forms.Cursor..ctor(System.Type类型,System.String资源)中[0x00021]   0:         在System.Windows.Forms.Cursors.get_SizeNWSE()[0x0001a]中的位置:: 0         在System.Windows.Forms.SizeGrip..ctor(System.Windows.Forms.Control CapturedControl)[0x00006]中   0:         在(包装器远程调用检查)System.Windows.Forms.SizeGrip:.ctor(System.Windows.Forms.Control)         在System.Windows.Forms.ScrollableControl.CreateScrollbars()[0x000c2]中:: 0         在System.Windows.Forms.ScrollableControl..ctor()[0x000b0]中:: 0         在System.Windows.Forms.ContainerControl..ctor()[0x0000e]中的位置:: 0         在System.Windows.Forms.Form..ctor()在[0x00012]中:: 0         在HelloWorld..ctor()[0x00000]在<6f95f68c33fe4d859a6075a68bb5c47f>:0中         在(包装器远程调用检查)HelloWorld:.ctor()         在HelloWorld.Main()[0x00000]在<6f95f68c33fe4d859a6075a68bb5c47f>:0中       [错误]致命异常:System.ArgumentException:发现空引用或无效值[GDI +状态:   无效的参数]         在<1917aa1c39d94b1a91807b8cd9f03350>:0中的System.Drawing.GDIPlus.CheckStatus(System.Drawing.Status状态)[0x0009b]处         在System.Drawing.Bitmap..ctor(System.Int32宽度,System.Int32高度,System.Drawing.Imaging.PixelFormat格式)[0x00017]中   <1917aa1c39d94b1a91807b8cd9f03350>:0         在System.Drawing.Bitmap..ctor(System.Drawing.Image原始,System.Int32宽度,System.Int32高度)处位于[0x00000]   <1917aa1c39d94b1a91807b8cd9f03350>:0         在System.Drawing.Bitmap..ctor中(System.Drawing.Image原始,System.Drawing.Size newSize)在[0x00010]中   <1917aa1c39d94b1a91807b8cd9f03350>:0         在(包装器远程调用检查)System.Drawing.Bitmap:.ctor(System.Drawing.Image,System.Drawing.Size)         在System.Windows.Forms.XplatUIX11.DefineCursor(System.Drawing.Bitmap位图,System.Drawing.Bitmap蒙版,   System.Drawing.Color cursor_pixel,System.Drawing.Color mask_pixel,   System.Int32 xHotSpot,System.Int32 yHotSpot)[0x0004e]在   0:         在System.Windows.Forms.XplatUI.DefineCursor(System.Drawing.Bitmap位图,System.Drawing.Bitmap蒙版,   System.Drawing.Color cursor_pixel,System.Drawing.Color mask_pixel,   System.Int32 xHotSpot,System.Int32 yHotSpot)[0x00000]在   0:         在System.Windows.Forms.Cursor.CreateCursor(System.IO.Stream流)[0x00058]中的位置:: 0         在System.Windows.Forms.Cursor..ctor(System.Type类型,System.String资源)中[0x00021]   0:         在System.Windows.Forms.Cursors.get_SizeNWSE()[0x0001a]中的位置:: 0         在System.Windows.Forms.SizeGrip..ctor(System.Windows.Forms.Control CapturedControl)[0x00006]中   0:         在(包装器远程调用检查)System.Windows.Forms.SizeGrip:.ctor(System.Windows.Forms.Control)         在System.Windows.Forms.ScrollableControl.CreateScrollbars()[0x000c2]中:: 0         在System.Windows.Forms.ScrollableControl..ctor()[0x000b0]中:: 0         在System.Windows.Forms.ContainerControl..ctor()[0x0000e]中的位置:: 0         在System.Windows.Forms.Form..ctor()在[0x00012]中:: 0         在HelloWorld..ctor()[0x00000]在<6f95f68c33fe4d859a6075a68bb5c47f>:0中         在(包装器远程调用检查)HelloWorld:.ctor()         在HelloWorld.Main()[0x00000]在<6f95f68c33fe4d859a6075a68bb5c47f>:0

我本来以为这可能是我的应用程序有问题,但是我尝试运行以下空白Winform应用程序(来自mono website)并收到相同的错误。

using System;
using System.Windows.Forms;

public class HelloWorld : Form
{
    static public void Main ()
    {
        Application.Run (new HelloWorld ());
    }

    public HelloWorld ()
    {
        Text = "Hello Mono World";
    }
}

通过查看错误消息和其他post似乎与加载游标有关,但是我对如何准确地解决该问题有些迷惑。该帖子很老,似乎找不到任何相关的视频驱动程序来解决硬件光标问题。也许我需要对X11配置进行调整?

1 个答案:

答案 0 :(得分:0)

通过使用视频驱动程序所需的设置来设置xorg.conf文件,可以解决此问题。一旦我做了这个单声道发行没有问题。下面是我使用的配置

Section "Monitor"
    Identifier      "Builtin Default Monitor"
EndSection

Section "Device"
        Identifier      "Builtin Default fbdev Device 0"
        Driver          "fbdev"
        Option          "fbdev"         "/dev/fb0"
        Option          "Rotate"        "UD"
EndSection

Section "Screen"
        Identifier      "Builtin Default fbdev Screen 0"
        Device          "Builtin Default fbdev Device 0"
        Monitor         "Builtin Default Monitor"
        DefaultDepth    24
EndSection

Section "ServerLayout"
        Identifier      "Builtin Default Layout"
        Screen          "Builtin Default fbdev Screen 0"
EndSection