Hi,
I wrote a simple windows forms net framework app but when i try running i…t using "mono hello.exe" i get an "null reference or invalid value was found" error. If i run the app on the same Pi but remote desktop in via xrdp then it runs without issue.
Error code:
'Unhandled` Exception:
System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
at System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status status) [0x00098] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00016] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Int32 width, System.Int32 height) [0x00000] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00010] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>: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) [0x00045] in <28e46de2d20c496895000ef0abfc2106>: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 <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursor.CreateCursor (System.IO.Stream stream) [0x00058] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursor..ctor (System.Type type, System.String resource) [0x0001e] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursors.get_SizeNWSE () [0x00014] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.SizeGrip..ctor (System.Windows.Forms.Control CapturedControl) [0x00006] in <28e46de2d20c496895000ef0abfc2106>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.SizeGrip..ctor(System.Windows.Forms.Control)
at System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.ContainerControl..ctor () [0x0000e] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Form..ctor () [0x00012] in <28e46de2d20c496895000ef0abfc2106>:0
at RpiMonitor.Form1..ctor () [0x000ba] in <cc43a35ccc774ee18cb1dd4e7629cd30>:0
at (wrapper remoting-invoke-with-check) RpiMonitor.Form1..ctor()
at RpiMonitor.Program.Main () [0x0000e] in <cc43a35ccc774ee18cb1dd4e7629cd30>: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) [0x00098] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00016] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Int32 width, System.Int32 height) [0x00000] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00010] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>: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) [0x00045] in <28e46de2d20c496895000ef0abfc2106>: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 <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursor.CreateCursor (System.IO.Stream stream) [0x00058] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursor..ctor (System.Type type, System.String resource) [0x0001e] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursors.get_SizeNWSE () [0x00014] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.SizeGrip..ctor (System.Windows.Forms.Control CapturedControl) [0x00006] in <28e46de2d20c496895000ef0abfc2106>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.SizeGrip..ctor(System.Windows.Forms.Control)
at System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.ContainerControl..ctor () [0x0000e] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Form..ctor () [0x00012] in <28e46de2d20c496895000ef0abfc2106>:0
at RpiMonitor.Form1..ctor () [0x000ba] in <cc43a35ccc774ee18cb1dd4e7629cd30>:0
at (wrapper remoting-invoke-with-check) RpiMonitor.Form1..ctor()
at RpiMonitor.Program.Main () [0x0000e] in <cc43a35ccc774ee18cb1dd4e7629cd30>:0
orangepi@orangepizero2:~/Documents/Sudo Logix Service Monitor$ ^C
orangepi@orangepizero2:~/Documents/Sudo Logix Service Monitor$ mono RpiMonitor.exe
Unhandled Exception:
System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
at System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status status) [0x00098] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00016] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Int32 width, System.Int32 height) [0x00000] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00010] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>: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) [0x00045] in <28e46de2d20c496895000ef0abfc2106>: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 <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursor.CreateCursor (System.IO.Stream stream) [0x00058] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursor..ctor (System.Type type, System.String resource) [0x0001e] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursors.get_SizeNWSE () [0x00014] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.SizeGrip..ctor (System.Windows.Forms.Control CapturedControl) [0x00006] in <28e46de2d20c496895000ef0abfc2106>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.SizeGrip..ctor(System.Windows.Forms.Control)
at System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.ContainerControl..ctor () [0x0000e] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Form..ctor () [0x00012] in <28e46de2d20c496895000ef0abfc2106>:0
at RpiMonitor.Form1..ctor () [0x000ba] in <cc43a35ccc774ee18cb1dd4e7629cd30>:0
at (wrapper remoting-invoke-with-check) RpiMonitor.Form1..ctor()
at RpiMonitor.Program.Main () [0x0000e] in <cc43a35ccc774ee18cb1dd4e7629cd30>: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) [0x00098] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00016] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Int32 width, System.Int32 height) [0x00000] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00010] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>: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) [0x00045] in <28e46de2d20c496895000ef0abfc2106>: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 <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursor.CreateCursor (System.IO.Stream stream) [0x00058] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursor..ctor (System.Type type, System.String resource) [0x0001e] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Cursors.get_SizeNWSE () [0x00014] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.SizeGrip..ctor (System.Windows.Forms.Control CapturedControl) [0x00006] in <28e46de2d20c496895000ef0abfc2106>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.SizeGrip..ctor(System.Windows.Forms.Control)
at System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.ContainerControl..ctor () [0x0000e] in <28e46de2d20c496895000ef0abfc2106>:0
at System.Windows.Forms.Form..ctor () [0x00012] in <28e46de2d20c496895000ef0abfc2106>:0
at RpiMonitor.Form1..ctor () [0x000ba] in <cc43a35ccc774ee18cb1dd4e7629cd30>:0
at (wrapper remoting-invoke-with-check) RpiMonitor.Form1..ctor()
at RpiMonitor.Program.Main () [0x0000e] in <cc43a35ccc774ee18cb1dd4e7629cd30>:0
orangepi@orangepizero2:~/Documents/Sudo Logix Service Monitor$ mono --debug RpiMonitor.exe
Unhandled Exception:
System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
at System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status status) [0x00098] in /build/mono-6.12.0.182/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:229
at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00016] in /build/mono-6.12.0.182/mcs/class/System.Drawing/System.Drawing/Bitmap.cs:95
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Int32 width, System.Int32 height) [0x00000] in /build/mono-6.12.0.182/mcs/class/System.Drawing/System.Drawing/Bitmap.cs:152
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00000] in /build/mono-6.12.0.182/mcs/class/System.Drawing/System.Drawing/Bitmap.cs:106
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) [0x0003b] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:3094
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 /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUI.cs:581
at System.Windows.Forms.Cursor.CreateCursor (System.IO.Stream stream) [0x00023] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursor.cs:110
at System.Windows.Forms.Cursor..ctor (System.Type type, System.String resource) [0x0001e] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursor.cs:160
at System.Windows.Forms.Cursors.get_SizeNWSE () [0x00014] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursors.cs:311
at System.Windows.Forms.SizeGrip..ctor (System.Windows.Forms.Control CapturedControl) [0x00006] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/SizeGrip.cs:47
at (wrapper remoting-invoke-with-check) System.Windows.Forms.SizeGrip..ctor(System.Windows.Forms.Control)
at System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollableControl.cs:968
at System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollableControl.cs:174
at System.Windows.Forms.ContainerControl..ctor () [0x0000e] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/ContainerControl.cs:54
at System.Windows.Forms.Form..ctor () [0x00012] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs:359
at RpiMonitor.Form1..ctor () [0x000ba] in <cc43a35ccc774ee18cb1dd4e7629cd30>:0
at (wrapper remoting-invoke-with-check) RpiMonitor.Form1..ctor()
at RpiMonitor.Program.Main () [0x0000e] in <cc43a35ccc774ee18cb1dd4e7629cd30>: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) [0x00098] in /build/mono-6.12.0.182/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:229
at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00016] in /build/mono-6.12.0.182/mcs/class/System.Drawing/System.Drawing/Bitmap.cs:95
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Int32 width, System.Int32 height) [0x00000] in /build/mono-6.12.0.182/mcs/class/System.Drawing/System.Drawing/Bitmap.cs:152
at System.Drawing.Bitmap..ctor (System.Drawing.Image original, System.Drawing.Size newSize) [0x00000] in /build/mono-6.12.0.182/mcs/class/System.Drawing/System.Drawing/Bitmap.cs:106
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) [0x0003b] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:3094
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 /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUI.cs:581
at System.Windows.Forms.Cursor.CreateCursor (System.IO.Stream stream) [0x00023] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursor.cs:110
at System.Windows.Forms.Cursor..ctor (System.Type type, System.String resource) [0x0001e] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursor.cs:160
at System.Windows.Forms.Cursors.get_SizeNWSE () [0x00014] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursors.cs:311
at System.Windows.Forms.SizeGrip..ctor (System.Windows.Forms.Control CapturedControl) [0x00006] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/SizeGrip.cs:47
at (wrapper remoting-invoke-with-check) System.Windows.Forms.SizeGrip..ctor(System.Windows.Forms.Control)
at System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollableControl.cs:968
at System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollableControl.cs:174
at System.Windows.Forms.ContainerControl..ctor () [0x0000e] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/ContainerControl.cs:54
at System.Windows.Forms.Form..ctor () [0x00012] in /build/mono-6.12.0.182/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs:359
at RpiMonitor.Form1..ctor () [0x000ba] in <cc43a35ccc774ee18cb1dd4e7629cd30>:0
at (wrapper remoting-invoke-with-check) RpiMonitor.Form1..ctor()
at RpiMonitor.Program.Main () [0x0000e] in <cc43a35ccc774ee18cb1dd4e7629cd30>:0
`
.cs file:
`using System;
public class HelloWorld
{
public static void Main(string[] args)
{
Console.WriteLine ("Hello Mono World");
}
}`