[Mono-dev] problem with System.Windows.Forms

amru rosyada arros.syada at gmail.com
Tue Feb 14 20:02:58 EST 2006


first I am sorry if my english is bad!

I have problem in using System.Windows.Forms with this simple code :

	//TestApp.cs
	using System.Windows.Forms;
	using System;

	class TestApp
	{
	 public static void Main()
	 {
	  Console.WriteLine("Testing! 1,2,3");
	  MessageBox.Show("Hello");
	 }
	}


The compiling is succeed but when I ran it,
I had any problem like this (please tell me what I miss):
thakns before!

amru at hikari:~/C#$ mcs TestApp.cs
-r:System.Windows.Forms.dllamru at hikari:~/C#$ mono TestApp.exe
Testing! 1,2,3

Unhandled Exception: System.TypeInitializationException: An exception
was thrown by the type initializer for System.Windows.Forms.Form --->
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
System.TypeInitializationException: An exception was thrown by the
type initializer for System.Drawing.GDIPlus --->
System.DllNotFoundException: gdiplus.dll
in (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup
(ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
in <0x000fa> System.Drawing.GDIPlus:.cctor ()--- End of inner
exception stack trace ---

in <0x00000> <unknown method>
in <0x001a5> System.Drawing.Image:InitFromStream (System.IO.Stream stream)
in <0x00107> System.Drawing.Bitmap:.ctor
(System.Runtime.Serialization.SerializationInfo info, StreamingContext
context)
in <0x00000> <unknown method>
in (wrapper managed-to-native)
System.Reflection.MonoCMethod:InternalInvoke (object,object[])
in <0x0008d> System.Reflection.MonoCMethod:Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo
culture)--- End of inner exception stack trace ---

in <0x0010e> System.Reflection.MonoCMethod:Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
in <0x0001a> System.Reflection.MethodBase:Invoke (System.Object obj,
System.Object[] parameters)
in <0x001e1> System.Runtime.Serialization.ObjectRecord:LoadData
(System.Runtime.Serialization.ObjectManager manager,
ISurrogateSelector selector, StreamingContext context)
in <0x00110> System.Runtime.Serialization.ObjectManager:DoFixups ()
in <0x00042> System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadNextObject
(System.IO.BinaryReader reader)
in <0x000b4> System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadObjectGraph
(System.IO.BinaryReader reader, Boolean readHeaders, System.Object
result, System.Runtime.Remoting.Messaging.Header[] headers)
in <0x0011f> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:NoCheckDeserialize
(System.IO.Stream serializationStream,
System.Runtime.Remoting.Messaging.HeaderHandler handler)
in <0x0000f> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Deserialize
(System.IO.Stream serializationStream)
in <0x00035> System.Resources.ResourceReader:ReadNonPredefinedValue
(System.Type exp_type)
in <0x00321> System.Resources.ResourceReader:ReadValueVer1 (System.Type type)
in <0x0017b> System.Resources.ResourceReader:ResourceValue (Int32 index)
in <0x00028> System.Resources.ResourceReader+ResourceEnumerator:get_Value ()
in <0x0008c> System.Resources.ResourceSet:ReadResources ()
in <0x00049> System.Resources.ResourceSet:GetObject (System.String
name, Boolean ignoreCase)
in <0x000c8> System.Resources.ResourceManager:GetObject (System.String
name, System.Globalization.CultureInfo culture)
in <0x00010> System.Resources.ResourceManager:GetObject (System.String name)
in <0x00017> System.Windows.Forms.Locale:GetResource (System.String name)
in <0x00011> System.Windows.Forms.Form:.cctor ()--- End of inner
exception stack trace ---

in <0x00000> <unknown method>
in <0x00014> System.Windows.Forms.MessageBox+MessageBoxForm:.ctor
(IWin32Window owner, System.String text, System.String caption,
MessageBoxButtons buttons, MessageBoxIcon icon)
in (wrapper remoting-invoke-with-check) MessageBoxForm:.ctor
(System.Windows.Forms.IWin32Window,string,string,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)
in <0x00029> System.Windows.Forms.MessageBox:Show (System.String text)
in <0x00017> TestApp:Main ()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060215/6987d012/attachment.html 


More information about the Mono-devel-list mailing list