我在 Debian 9 和带有 Armv7 的内核 4.9 上使用 Mono 版本 4.6.2(来自 apt)运行 winforms 应用程序时遇到了很多麻烦。我也尝试过Mono install guide中的 Mono 5.18 ,但我遇到了同样的错误。该项目以前在 Debian 7 上运行,内核为 3.0,并且运行良好。
每当我尝试运行我的应用程序时,我都会看到以下错误:
未处理的异常:System.ArgumentException:在 System.Drawing 的 <1917aa1c39d94b1a91807b8cd9f03350>:0 中的 System.Drawing.GDIPlus.CheckStatus(System.Drawing.Status 状态)[0x0009b] 中找到空引用或无效值 [GDI+ 状态:InvalidParameter] .Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat 格式) [0x00017] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at System.Drawing.Bitmap..ctor (System.Drawing.Image original , System.Int32 宽度, System.Int32 高度) [0x00000] in <1917aa1c39d94b1a91807b8cd9f03350>:0 在 System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00010] in <1917aa1c39d94b1a350f807cd94b1a351807 >:0 at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor (System.Drawing.Bitmap:.ctor)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] in :0 at 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] in :0 at System.Windows.Forms.Cursor.CreateCursor (System.IO.Stream stream) [0x00058] in :0 at System.Windows.Forms .Cursor..ctor(System.Type 类型,System.String 资源)[0x00021] 在 System.Windows.Forms.Cursors.get_SizeNWSE () [0x0001a] 在 System.Windows.Forms.Cursors.get_SizeNWSE () [0x0001a] 在:0 在 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) 在系统。 Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in :0 在 System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in :0 在 System.Windows.Forms.ContainerControl..ctor () [0x0000e]在 System.Windows.Forms.Form..ctor () [0x00012] 处的 :0 在 HelloWorld..ctor () [0x00000] 处的 0 处 <6f95f68c33fe4d859a6075a68bb5c47f>:0 在 (wrapper remoting-invoke-with-check) HelloWorld :.ctor () at HelloWorld.Main () [0x00000] in <6f95f68c33fe4d859a6075a68bb5c47f>:0 [错误] 致命未处理异常:System.ArgumentException:找到空引用或无效值 [GDI+ 状态: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 格式)[0x00017] in <1917aa1c39d94b1a91807b8cd9f03350>:0 在 System.Drawing.Bitmap..ctor (System.Drawing.Image 原始,System.Int32 宽度,System.Int32 高度)[0x00000] in <1917aa1c39d94b03501807b8cd 0 在 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) 在 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 位图,System.Drawing.Bitmap 掩码,System.Drawing.Color cursor_pixel,System.Drawing.Color mask_pixel,System.Int32 xHotSpot,System.Int32 yHotSpot)[0x00000] 在 System.Windows 中:0。 Forms.Cursor.CreateCursor(System.IO.Stream 流)[0x00058] 在 System.Windows.Forms.Cursor..ctor 的 0 处(System.Type 类型,System.String 资源)[0x00021] 在 System 的 0 处。 Windows.Forms.Cursors.get_SizeNWSE () [0x0001a] in :0 在 System.Windows.Forms.SizeGrip..ctor (System.Windows.Forms.Control CapturedControl) [0x00006] 在: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 在 System.Windows.Forms.ContainerControl..ctor () [0x0000e] in :0 在 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>:0ScrollableControl..ctor () [0x000b0] in :0 在 System.Windows.Forms.ContainerControl..ctor () [0x0000e] in :0 在 System.Windows.Forms.Form..ctor () [0x00012] in :0在 <6f95f68c33fe4d859a6075a68bb5c47f>:0 中的 HelloWorld..ctor () [0x00000] 在 (wrapper remoting-invoke-with-check) HelloWorld:.ctor () 在 <6f95f68c33fe4d859a6075a68bb5c47f> 中的 HelloWorld.Main () [0x00000]:0ScrollableControl..ctor () [0x000b0] in :0 在 System.Windows.Forms.ContainerControl..ctor () [0x0000e] in :0 在 System.Windows.Forms.Form..ctor () [0x00012] in :0在 <6f95f68c33fe4d859a6075a68bb5c47f>:0 中的 HelloWorld..ctor () [0x00000] 在 (wrapper remoting-invoke-with-check) HelloWorld:.ctor () 在 <6f95f68c33fe4d859a6075a68bb5c47f> 中的 HelloWorld.Main () [0x00000]:0
我最初认为这可能是我的应用程序的问题,但我尝试运行以下空白 winform 应用程序(来自mono 网站)并收到相同的错误。
using System;
using System.Windows.Forms;
public class HelloWorld : Form
{
static public void Main ()
{
Application.Run (new HelloWorld ());
}
public HelloWorld ()
{
Text = "Hello Mono World";
}
}
通过查看错误消息和this other post,加载光标似乎是一个问题,但我对如何解决这个问题有点迷茫。该帖子很旧,似乎找不到任何相关的视频驱动程序来解决硬件光标问题。也许我需要调整我的 X11 配置?