[Mono-winforms-list] running winforms application on OS X

Paul Berry paulb at premiere-employment.co.uk
Wed Jan 23 11:56:32 EST 2008


HI all, hopefully someone can help with this, I've been googling for
answers to this problem for 2 days now without any luck.

 

Basically, I'm at the stage where my application (originally written in
.Net, ported to mono on linux, now trying to port to OS X) compiles
fine, but running it provokes the error at the bottom of this message.

 

Further testing has revealed that this error occurs for *any* mono
application.  Googling has revealed several cases of this error with
winforms on OS X but no useful solution.  I've tried copying fonts from
my windows machine to ~/fonts and running mkfontdir on that directory
but this results in 'Bus error'.  

 

Please help!

 

Here's the error:

 

Unhandled Exception: System.TypeInitializationException: An exception
was thrown

 by the type initializer for
System.Windows.Forms.WindowsFormsSynchronizationCon

text ---> System.TypeInitializationException: An exception was thrown by
the typ

e 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)
[0x0000

0] 

  at (wrapper remoting-invoke-with-check)
System.Drawing.FontFamily:.ctor (Syste

m.Drawing.Text.GenericFontFamilies)

  at System.Drawing.FontFamily.get_GenericSansSerif () [0x00000] 

  at System.Drawing.Font.CreateFont (System.String familyName, Single
emSize, Fo

ntStyle style, GraphicsUnit unit, Byte charSet, Boolean isVertical)
[0x00000] 

  at System.Drawing.Font..ctor (System.String familyName, Single emSize,
FontSty

le 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,sing

le,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 excep

tion 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.CreatePa

rams cp, System.Windows.Forms.Menu menu, Rectangle client_rect)
[0x00000] 

  at System.Windows.Forms.XplatUIOSX.CalculateWindowRect
(System.Drawing.Rectang

le& 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 men

u, 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 WindowsApplication1.Form1..ctor () [0x00000]

 

IMPORTANT NOTICE:
-------------------------------------

This E-Mail and any files transmitted with it are confidential and are intended solely for the use of the intended recipient(s).
If you are not the intended recipient, you must not copy, distribute or take any action based on this communication.
If you have received this communication in error please contact the sender and delete this communication and any copies of it.
Any views or opinions presented are solely those of the author and do not necessarily represent those of Premiere Employment Group Ltd.
Premiere Employment Group Ltd monitors E-Mails to ensure its systems operates effectively and to minimise the risk of viruses.
Any file attachments to this communication will have been virus checked prior to transmission, however you should carry out your own virus check before opening.
We do not accept liability for any damage or loss that may occur from software viruses.

Premiere Employment Group Ltd
7th Floor, Blackfriars House
1 The Parsonage
Manchester
M3 2JA

Fax: 0161 832 0307

www.premierepeople.com

Premiere People is the trading name of Premiere Employment Group Ltd 
4963501 
Registered Address: Chevron House, 
346 Long Lane, 
Hillingdon, 
Middlesex, 
UB10 9PF


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20080123/de2a993f/attachment-0001.html 


More information about the Mono-winforms-list mailing list