【发布时间】:2019-07-12 03:56:45
【问题描述】:
在 Debian 9 和带有 Armv7 的内核 4.9 上运行使用 Mono 版本 4.6.2(来自 apt)的 winforms 应用程序时遇到了很多麻烦。我也尝试过使用 Mono install guide 的 Mono 5.18,但我遇到了同样的错误。该项目以前在 Debian 7 上运行,内核为 3.0,并且运行良好。
每当我尝试运行我的应用程序时,我都会看到以下错误:
未处理的异常: System.ArgumentException:找到空引用或无效值 [GDI+ 状态:无效参数] 在 System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status 状态) [0x0009b] 在 :0 在 System.Drawing.Bitmap..ctor(System.Int32 宽度,System.Int32 高度,System.Drawing.Imaging.PixelFormat 格式)[0x00017] 中 :0 在 System.Drawing.Bitmap..ctor(System.Drawing.Image 原始,System.Int32 宽度,System.Int32 高度)[0x00000] 中 :0 在 System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00010] 中 :0 在 (wrapper remoting-invoke-with-check) 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 在 (wrapper remoting-invoke-with-check) System.Windows.Forms.SizeGrip:.ctor (System.Windows.Forms.Control) 在 System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in :0 在 System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in :0 在 System.Windows.Forms.ContainerControl..ctor () [0x0000e] in :0 在 System.Windows.Forms.Form..ctor () [0x00012] 中:0 在 :0 中的 HelloWorld..ctor () [0x00000] 在 (wrapper remoting-invoke-with-check) HelloWorld:.ctor () 在 :0 中的 HelloWorld.Main () [0x00000] [错误] 致命的未处理异常:System.ArgumentException:找到空引用或无效值 [GDI+ 状态: 无效的参数] 在 System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status 状态) [0x0009b] 在 :0 在 System.Drawing.Bitmap..ctor(System.Int32 宽度,System.Int32 高度,System.Drawing.Imaging.PixelFormat 格式)[0x00017] 中 :0 在 System.Drawing.Bitmap..ctor(System.Drawing.Image 原始,System.Int32 宽度,System.Int32 高度)[0x00000] 中 :0 在 System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00010] 中 :0 在 (wrapper remoting-invoke-with-check) 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 在 (wrapper remoting-invoke-with-check) System.Windows.Forms.SizeGrip:.ctor (System.Windows.Forms.Control) 在 System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in :0 在 System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in :0 在 System.Windows.Forms.ContainerControl..ctor () [0x0000e] in :0 在 System.Windows.Forms.Form..ctor () [0x00012] 中:0 在 :0 中的 HelloWorld..ctor () [0x00000] 在 (wrapper remoting-invoke-with-check) HelloWorld:.ctor () 在 :0
中的 HelloWorld.Main () [0x00000]
我最初认为这可能是我的应用程序的问题,但我尝试运行以下空白 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 配置?
【问题讨论】:
标签: c# winforms mono debian armv7