[Mono-osx] Winforms error

Flavio Antonioli flavio.antonioli at memopal.com
Mon Feb 4 09:19:20 EST 2008


Hello,

I'm trying to port a Winforms application to mono on OSX.
I've tested the application with the Windows Mono runtime and it works,
I get the exception reported below when trying to launch the  
application under OSX (10.4.8 with mono 1.2.6_5).
I get the same error when launching mono with the X11 driver and with  
the native OSX driver (i.e. setting export  
MONO_MWF_USE_QUARTZ_BACKEND=1 and export MONO_MWF_USE_QUARTZ_BACKEND=1).
I've read somewhere that the problem might be solved installing the  
"xorg-fonts" package, but I haven't been able to find any such  
package with fink or macports.

Any ideas?

Thanks,
Flavio.

Unhandled Exception: System.TypeInitializationException: An exception  
was thrown by the type initializer for  
System.Windows.Forms.WindowsFormsSynchronizationContext --->  
System.TypeInitializationException: An exception was thrown by the  
type initializer for System.Windows.Forms.ThemeEngine --->  
System.ArgumentException: The requested FontFamily could not be found  
[GDI+ status: FontFamilyNotFound]
   at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000]
   at System.Drawing.FontFamily..ctor (GenericFontFamilies  
genericFamily) [0x00000]
   at (wrapper remoting-invoke-with-check)  
System.Drawing.FontFamily:.ctor  
(System.Drawing.Text.GenericFontFamilies)
   at System.Drawing.FontFamily.get_GenericSansSerif () [0x00000]
   at System.Drawing.Font.CreateFont (System.String familyName,  
Single emSize, FontStyle style, GraphicsUnit unit, Byte charSet,  
Boolean isVertical) [0x00000]
   at System.Drawing.Font..ctor (System.String familyName, Single  
emSize, FontStyle style, GraphicsUnit unit, Byte charSet, Boolean  
isVertical) [0x00000]
   at System.Drawing.Font..ctor (System.String familyName, Single  
emSize, System.String systemName) [0x00000]
   at (wrapper remoting-invoke-with-check) System.Drawing.Font:.ctor  
(string,single,string)
   at System.Drawing.SystemFonts.get_DefaultFont () [0x00000]
   at System.Windows.Forms.Theme..ctor () [0x00000]
   at System.Windows.Forms.ThemeWin32Classic..ctor () [0x00000]
   at System.Windows.Forms.ThemeEngine..cctor () [0x00000] --- End of  
inner exception stack trace ---

   at System.Windows.Forms.Hwnd.GetBorderWidth  
(System.Windows.Forms.CreateParams cp) [0x00000]
   at System.Windows.Forms.Hwnd.GetBorders  
(System.Windows.Forms.CreateParams cp, System.Windows.Forms.Menu  
menu) [0x00000]
   at System.Windows.Forms.Hwnd.GetWindowRectangle  
(System.Windows.Forms.CreateParams cp, System.Windows.Forms.Menu  
menu, Rectangle client_rect) [0x00000]
   at System.Windows.Forms.XplatUIOSX.CalculateWindowRect  
(System.Drawing.Rectangle& ClientRect,  
System.Windows.Forms.CreateParams cp, System.Windows.Forms.Menu menu,  
System.Drawing.Rectangle& WindowRect) [0x00000]
   at System.Windows.Forms.XplatUI.CalculateWindowRect  
(System.Drawing.Rectangle& ClientRect,  
System.Windows.Forms.CreateParams cp, System.Windows.Forms.Menu menu,  
System.Drawing.Rectangle& WindowRect) [0x00000]
   at System.Windows.Forms.Control.InternalSizeFromClientSize (Size  
clientSize) [0x00000]
   at System.Windows.Forms.Control.ClientSizeFromSize (Size size)  
[0x00000]
   at System.Windows.Forms.Control..ctor () [0x00000]
   at (wrapper remoting-invoke-with-check)  
System.Windows.Forms.Control:.ctor ()
   at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor  
() [0x00000] --- End of inner exception stack trace ---

   at System.Windows.Forms.Control..ctor () [0x00000]
   at System.Windows.Forms.ScrollableControl..ctor () [0x00000]
   at System.Windows.Forms.ContainerControl..ctor () [0x00000]
   at System.Windows.Forms.Form..ctor () [0x00000]
   at MA.Utility.InterprocessMessages..ctor () [0x00000]
   at (wrapper remoting-invoke-with-check)  
MA.Utility.InterprocessMessages:.ctor ()
   at MA.MemopalController..ctor () [0x00000]
   at MA.Program.DoRun () [0x00000]
   at MA.Program.Main (System.String[] args) [0x00000]



More information about the Mono-osx mailing list