Mono libgdiplus 在 Armv7 Debian 9 构建上崩溃

Mono libgdiplus crash on Armv7 Debian 9 build

我在获取 winforms 应用程序时遇到了很多麻烦 运行 Debian 9 上的 Mono 版本 4.6.2(来自 apt),Kernel 4.9 with Armv7。我也尝试过 Mono install guide 的 Mono 5.18,但我遇到了同样的错误。该项目之前 运行 在具有 3.0 内核的 D​​ebian 7 上运行并且 运行 很好。

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

Unhandled Exception: System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter] at System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status status) [0x0009b] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00017] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Int32 width, System.Int32 height) [0x00000] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00010] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor (System.Drawing.Image,System.Drawing.Size) at System.Windows.Forms.XplatUIX11.DefineCursor (System.Drawing.Bitmap bitmap, System.Drawing.Bitmap mask, System.Drawing.Color cursor_pixel, System.Drawing.Color mask_pixel, System.Int32 xHotSpot, System.Int32 yHotSpot) [0x0004e] in :0 at System.Windows.Forms.XplatUI.DefineCursor (System.Drawing.Bitmap bitmap, System.Drawing.Bitmap mask, System.Drawing.Color cursor_pixel, System.Drawing.Color mask_pixel, System.Int32 xHotSpot, System.Int32 yHotSpot) [0x00000] in :0 at System.Windows.Forms.Cursor.CreateCursor (System.IO.Stream stream) [0x00058] in :0 at System.Windows.Forms.Cursor..ctor (System.Type type, System.String resource) [0x00021] in :0 at System.Windows.Forms.Cursors.get_SizeNWSE () [0x0001a] in :0 at System.Windows.Forms.SizeGrip..ctor (System.Windows.Forms.Control CapturedControl) [0x00006] in :0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.SizeGrip:.ctor (System.Windows.Forms.Control) at System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in :0 at System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in :0 at System.Windows.Forms.ContainerControl..ctor () [0x0000e] in :0 at System.Windows.Forms.Form..ctor () [0x00012] in :0 at HelloWorld..ctor () [0x00000] in <6f95f68c33fe4d859a6075a68bb5c47f>:0 at (wrapper remoting-invoke-with-check) HelloWorld:.ctor () at HelloWorld.Main () [0x00000] in <6f95f68c33fe4d859a6075a68bb5c47f>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter] at System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status status) [0x0009b] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00017] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Int32 width, System.Int32 height) [0x00000] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00010] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor (System.Drawing.Image,System.Drawing.Size) at System.Windows.Forms.XplatUIX11.DefineCursor (System.Drawing.Bitmap bitmap, System.Drawing.Bitmap mask, System.Drawing.Color cursor_pixel, System.Drawing.Color mask_pixel, System.Int32 xHotSpot, System.Int32 yHotSpot) [0x0004e] in :0 at System.Windows.Forms.XplatUI.DefineCursor (System.Drawing.Bitmap bitmap, System.Drawing.Bitmap mask, System.Drawing.Color cursor_pixel, System.Drawing.Color mask_pixel, System.Int32 xHotSpot, System.Int32 yHotSpot) [0x00000] in :0 at System.Windows.Forms.Cursor.CreateCursor (System.IO.Stream stream) [0x00058] in :0 at System.Windows.Forms.Cursor..ctor (System.Type type, System.String resource) [0x00021] in :0 at System.Windows.Forms.Cursors.get_SizeNWSE () [0x0001a] in :0 at System.Windows.Forms.SizeGrip..ctor (System.Windows.Forms.Control CapturedControl) [0x00006] in :0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.SizeGrip:.ctor (System.Windows.Forms.Control) at System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in :0 at System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in :0 at System.Windows.Forms.ContainerControl..ctor () [0x0000e] in :0 at System.Windows.Forms.Form..ctor () [0x00012] in :0 at HelloWorld..ctor () [0x00000] in <6f95f68c33fe4d859a6075a68bb5c47f>:0 at (wrapper remoting-invoke-with-check) HelloWorld:.ctor () at HelloWorld.Main () [0x00000] in <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,这似乎是加载光标的问题,但我对如何解决这个问题有点迷茫。 post 很旧,似乎找不到任何相关的视频驱动程序来修复硬件光标问题。也许我需要调整我的 X11 配置?

我可以通过使用我的视频驱动程序所需的设置设置一个 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