[Mono-osx] Mono 1.9.1/Winforms crash on Mac OSX

Geoff Norton gnorton at novell.com
Tue Jun 17 20:07:04 EDT 2008


You need to install X11.  We dont use it to render, but apple puts
libfontconfig and libfreetype inside the X11 package.

-g

On Tue, 2008-06-17 at 18:29 -0400, Brian Dunstan wrote:
> Hello,
> 
> I am trying to build a winforms application using Monodevelop, on Mac OS
> X 10.5.3.   A Visual Studio template application (attached) crashes.  I
> have mono 1.9.1 and Cocoa# 0.94 installed, but X11 is not installed, by
> design.
> 
> My understanding is that mono 1.9.1 supports winforms natively on OSX,
> without using X11.  Can someone please let me know if I am on the right
> track here, or need some additional libraries installed?
> 
> 
> Thanks,
> 
> Brian Dunstan
> 
> 
> Code:
> using System;
> using System.Collections.Generic;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Text;
> using System.Windows.Forms;
> 
> namespace test_win_project
> {
>     public partial class Form1 : Form
>     {
>         public Form1()
>         {
>             InitializeComponent();
>         }
>     }
> }
> 
> 
> Stacktrace:
> 
> 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:
> /Library/Frameworks/Mono.framework/Versions/1.9.1/lib/libgdiplus.dylib
>   at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup
> (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartu
> pOutput&)
>   at System.Drawing.GDIPlus..cctor () [0x000bf] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/System.Drawing/S
> ystem.Drawing/gdipFunctions.cs:126 --- End of inner exception stack
> trace ---
> 
>   at System.Drawing.Image.InitFromStream (System.IO.Stream stream)
> [0x00066] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/System.Drawing/S
> ystem.Drawing/Image.cs:285 
>   at System.Drawing.Image..ctor
> (System.Runtime.Serialization.SerializationInfo info, StreamingContext
> context) [0x00055] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/System.Drawing/S
> ystem.Drawing/Image.cs:74 
>   at System.Drawing.Bitmap..ctor
> (System.Runtime.Serialization.SerializationInfo info, StreamingContext
> context) [0x00000] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/System.Drawing/S
> ystem.Drawing/Bitmap.cs:148 
>   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)
> [0x0003f] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> flection/MonoMethod.cs:404 --- 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)
> [0x00064] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> flection/MonoMethod.cs:414 
>   at System.Reflection.MethodBase.Invoke (System.Object obj,
> System.Object[] parameters) [0x00000] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> flection/MethodBase.cs:90 
>   at System.Runtime.Serialization.ObjectRecord.LoadData
> (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector
> selector, StreamingContext context) [0x000d7] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Ru
> ntime.Serialization/ObjectManager.cs:578 
>   at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00069] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Ru
> ntime.Serialization/ObjectManager.cs:84 
>   at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObje
> ct (System.IO.BinaryReader reader) [0x0000f] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Ru
> ntime.Serialization.Formatters.Binary/ObjectReader.cs:115  
>   at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGr
> aph (System.IO.BinaryReader reader, Boolean readHeaders, System.Object&
> result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x00041]
> in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Ru
> ntime.Serialization.Formatters.Binary/ObjectReader.cs:105 
>   at
> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDe
> serialize (System.IO.Stream serializationStream,
> System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00076] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Ru
> ntime.Serialization.Formatters.Binary/BinaryFormatter.cs:177 
>   at
> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deseriali
> ze (System.IO.Stream serializationStream) [0x00000] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Ru
> ntime.Serialization.Formatters.Binary/BinaryFormatter.cs:134 
>   at System.Resources.ResourceReader.ReadNonPredefinedValue (System.Type
> exp_type) [0x00000] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> sources/ResourceReader.cs:351 
>   at System.Resources.ResourceReader.ReadValueVer1 (System.Type type)
> [0x001d9] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> sources/ResourceReader.cs:345 
>   at System.Resources.ResourceReader.ResourceValue (Int32 index)
> [0x000a1] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> sources/ResourceReader.cs:397 
>   at System.Resources.ResourceReader+ResourceEnumerator.get_Value ()
> [0x00032] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> sources/ResourceReader.cs:603 
>   at System.Resources.ResourceSet.ReadResources () [0x00043] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> sources/ResourceSet.cs:208 
>   at System.Resources.ResourceSet.GetObject (System.String name, Boolean
> ignoreCase) [0x00032] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> sources/ResourceSet.cs:163 
>   at System.Resources.ResourceManager.GetObject (System.String name,
> System.Globalization.CultureInfo culture) [0x00038] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> sources/ResourceManager.cs:186 
>   at System.Resources.ResourceManager.GetObject (System.String name)
> [0x00000] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System.Re
> sources/ResourceManager.cs:170 
>   at System.Windows.Forms.Locale.GetResource (System.String name)
> [0x00000] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/Managed.Windows.
> Forms/Assembly/Locale.cs:76 
>   at System.Windows.Forms.Form..cctor () [0x000c8] in
> /private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/Managed.Windows.
> Forms/System.Windows.Forms/Form.cs:108 --- End of inner exception stack
> trace ---
> 
>   at test_win_project.Form1..ctor () [0x00007] in
> /Users/bdunstan/src/test-win-project/test-win-project/Form1.cs:13 
>   at (wrapper remoting-invoke-with-check) test_win_project.Form1:.ctor
> ()
>   at test_win_project.Program.Main () [0x0000b] in
> /Users/bdunstan/src/test-win-project/Program.cs:17 
> 
> 
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx



More information about the Mono-osx mailing list