GUI Form Exception when running C# form on Mono
-
Hey All, I am trying to run a C# GUI Form on Fedora 8 using mono. If I run console applications, everything runs fine, but if I try to run a simple GUI application, I get the following exception (by the way, I didn't have to install mono, since it came with Fedora 8, but my guess is I am missing a graphic component needed to run GUI forms):
mono HelloWorldGUICS.exe 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 at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x00000] --- End of inner exception stack trace --- at <0x00000> at System.Drawing.Image.InitFromStream (System.IO.Stream stream) [0x00000] at System.Drawing.Image..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] at System.Drawing.Bitmap..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] at <0x00000> at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[]) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000] at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (System.IO.BinaryReader reader) [0x00000] at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (System.IO.BinaryReader read
-
Hey All, I am trying to run a C# GUI Form on Fedora 8 using mono. If I run console applications, everything runs fine, but if I try to run a simple GUI application, I get the following exception (by the way, I didn't have to install mono, since it came with Fedora 8, but my guess is I am missing a graphic component needed to run GUI forms):
mono HelloWorldGUICS.exe 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 at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x00000] --- End of inner exception stack trace --- at <0x00000> at System.Drawing.Image.InitFromStream (System.IO.Stream stream) [0x00000] at System.Drawing.Image..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] at System.Drawing.Bitmap..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] at <0x00000> at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[]) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000] at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (System.IO.BinaryReader reader) [0x00000] at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (System.IO.BinaryReader read
DigiOz Multimedia wrote:
System.DllNotFoundException: gdiplus.dll
As far as I can see, you're missing a DLL called gdiplus.dll.
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
-
Hey All, I am trying to run a C# GUI Form on Fedora 8 using mono. If I run console applications, everything runs fine, but if I try to run a simple GUI application, I get the following exception (by the way, I didn't have to install mono, since it came with Fedora 8, but my guess is I am missing a graphic component needed to run GUI forms):
mono HelloWorldGUICS.exe 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 at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x00000] --- End of inner exception stack trace --- at <0x00000> at System.Drawing.Image.InitFromStream (System.IO.Stream stream) [0x00000] at System.Drawing.Image..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] at System.Drawing.Bitmap..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] at <0x00000> at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[]) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000] at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (System.IO.BinaryReader reader) [0x00000] at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (System.IO.BinaryReader read
If you are missing the GDI+ dll, that would explain why the error only happens with GUI apps. GDI+ is the whole drawing library thing that c# uses.
My current favourite word is: PIE! Good ol' pie, it's been a while.
-
If you are missing the GDI+ dll, that would explain why the error only happens with GUI apps. GDI+ is the whole drawing library thing that c# uses.
My current favourite word is: PIE! Good ol' pie, it's been a while.
The Undefeated wrote:
If you are missing the GDI+ dll, that would explain why the error only happens with GUI apps. GDI+ is the whole drawing library thing that c# uses.
Found this article which seemed to explain at least one of the errors above: http://www.mono-project.com/DllNotFoundException[^] It didn't fix my problem though, because even though there was a GDI+ library at "/usr/lib", it was called "libgdiplus.so.0" and "libgdiplus.so.0.0.0" (wrong folder and wrong name). I tried to reinstall the GDI+ library, but the machine froze and I had to reboot to get it back. :(
Pete Soheil DigiOz Multimedia http://www.digioz.com
-
Hey All, I am trying to run a C# GUI Form on Fedora 8 using mono. If I run console applications, everything runs fine, but if I try to run a simple GUI application, I get the following exception (by the way, I didn't have to install mono, since it came with Fedora 8, but my guess is I am missing a graphic component needed to run GUI forms):
mono HelloWorldGUICS.exe 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 at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x00000] --- End of inner exception stack trace --- at <0x00000> at System.Drawing.Image.InitFromStream (System.IO.Stream stream) [0x00000] at System.Drawing.Image..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] at System.Drawing.Bitmap..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] at <0x00000> at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[]) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000] at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (System.IO.BinaryReader reader) [0x00000] at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (System.IO.BinaryReader read
DigiOz Multimedia wrote:
If I run console applications, everything runs fine, but if I try to run a simple GUI application, I get the following exception
Finally found the solution to my problem. There was nothing wrong with GDI+, Mono or any other package on the system. The problem was Fedora 8s new Security System!! If I log in as root (not a good practice) and run the same application the GUI Application executes fine. So I think their new security system needs some more work. :laugh: Thank you everyone who tried to help.
Pete Soheil DigiOz Multimedia http://www.digioz.com