[Mono-list] System.Windows.Forms test

Santi Serrano santi.serrano at bigfoot.com
Tue Jul 26 18:57:47 EDT 2005


I am trying to compile and execute a simple program that only shows a form 
but I get the folowing error when executing:

Unhandled Exception: System.TypeInitializationException: An exception was 
thrown  by the type initializer for System.Windows.Forms.XplatUI ---> 
System.Reflection .TargetInvocationException: Exception has been thrown by 
the target of an invoca tion. ---> System.NotSupportedException: Either 
image format is unknown or you d on't have the required libraries for this 
in <0x0014a> System.Drawing.GDIPlus:CheckStatus (Status status)
in <0x000ca> System.Drawing.Image:InitFromStream (System.IO.Stream stream)
in (wrapper remoting-invoke-with-check) System.Drawing.Image:InitFromStream 
(Sys tem.IO.Stream)
in <0x00104> System.Drawing.Bitmap:.ctor 
(System.Runtime.Serialization.Serializa tionInfo info, StreamingContext 
in <0x00000> <unknown method>
in (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke 
(obj ect,object[])

The source code:

using System;
using System.Windows.Forms;

public class Form1 : Form
  public static void Main()
    Application.Run(new Form1());

I am using the ubuntu live mono cd with the following commands:

mcs Form1.cs -r:System.Windows.Forms          -> OK
mono Form1.exe                                -> KO

Thank you for you help.

More information about the Mono-list mailing list