Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. GUI Form Exception when running C# form on Mono

GUI Form Exception when running C# form on Mono

Scheduled Pinned Locked Moved C#
graphicscsharpc++data-structuresdebugging
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DigiOz Multimedia
    wrote on last edited by
    #1

    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

    K A D 3 Replies Last reply
    0
    • D DigiOz Multimedia

      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

      K Offline
      K Offline
      Kristian Sixhoj
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • D DigiOz Multimedia

        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

        A Offline
        A Offline
        Anthony Mushrow
        wrote on last edited by
        #3

        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.

        D 1 Reply Last reply
        0
        • A Anthony Mushrow

          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.

          D Offline
          D Offline
          DigiOz Multimedia
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • D DigiOz Multimedia

            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

            D Offline
            D Offline
            DigiOz Multimedia
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups