[Mono-dev] SystemIcons.Exclamation produces an exception.

caz yokoyama caz at caztech.com
Sat Dec 2 08:44:51 EST 2006


Has anyone ever used SystemIcons.Exclamation? It produces an exception while
it works on Windows. Is this a bug or am I missing something?

 

------------ icon.cs ----------

using System;

using System.Drawing;

using System.Collections;

using System.Drawing.Imaging;

using System.Security.Cryptography;

 

class icon

{

            public static void Main () {

                        Icon aaa = new Icon(SystemIcons.Exclamation, 40,
40);

                        Console.WriteLine("Hello World");

            }

}

 

-------------- log ---------

[caz at localhost icon]$ mcs -debug  -r:System.Drawing.dll icon.cs

icon.cs(10,8): warning CS0219: The variable `aaa' is assigned but its value
is never used

Compilation succeeded - 1 warning(s)

[caz at localhost icon]$ mono --debug icon.exe

 

Unhandled Exception: System.NullReferenceException: Object reference not set
to an instance of an object

  at System.Drawing.Icon..ctor (System.Drawing.Icon original, Size size)
[0x0001f] in
/tmp/scratch/BUILD/mono-1.2.1/mcs/class/System.Drawing/System.Drawing/Icon.c
s:129

  at System.Drawing.Icon..ctor (System.Drawing.Icon original, Int32 width,
Int32 height) [0x00000] in
/tmp/scratch/BUILD/mono-1.2.1/mcs/class/System.Drawing/System.Drawing/Icon.c
s:122

  at (wrapper remoting-invoke-with-check) System.Drawing.Icon:.ctor
(System.Drawing.Icon,int,int)

  at icon.Main () [0x00000] in /home/caz/umd/icon/icon.cs:10

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061202/641ea024/attachment.html 


More information about the Mono-devel-list mailing list