[Mono-winforms-list] help needed on gdiplus error on app startup...

Sebastien Pouliot sebastien.pouliot at gmail.com
Mon Mar 22 21:13:19 EDT 2010


On Mon, 2010-03-22 at 13:15 -0800, KFD wrote:
> My first attempt on porting a .net 3.5 app to mono...
> 
> MoMA says no porting issues, so I attempt to run using new install of mono
> 2.6.3...
> 
> and get the following (snipped for brevity)...
> 
> System.ArgumentException: A null reference or invalid value was found [GDI+
> stat
> us: InvalidParameter]
>   at System.Drawing.GDIPlus.CheckStatus (Status status) [0x0009d] in
> C:\cygwin\t
> mp\monobuild\build\BUILD\mono-2.6.3\mcs\class\System.Drawing\System.Drawing\gdip
> Functions.cs:219
>   at System.Drawing.Bitmap..ctor (Int32 width, Int32 height, PixelFormat
> format)
>  [0x00017] in
> C:\cygwin\tmp\monobuild\build\BUILD\mono-2.6.3\mcs\class\System.Dr
> awing\System.Drawing\Bitmap.cs:97
>   at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor
> (int,int,S
> ystem.Drawing.Imaging.PixelFormat)
> ...
> 
> 
> For some reason, the build path seems to be under my Cygwin directory, but
> when I look under c:\cygwin\tmp, there is nothing there, so I cant check out
> the source where the exception is occurring...
> 
> Anyone have insight into this error, and/or where the missing source files
> have disappeared to?

The file names/paths are stored in the debugging symbols - which are
created at compilation time. If you installed the binaries only then the
file simply don't exists on your system.

> It looks like mono GDI+ dll hasnt been loaded/initialized yet?... 

Possible but unlikely as the exception would have occurred earlier
(there are calls to GDI+ before that). Sadly GDI+ does not report much
details on failure so you have a bit of testing to do.

Try adding some output on the console about the parameters (width,
height and format). My guess one of them is not valid (e.g. 0).

Sebastien



More information about the Mono-winforms-list mailing list