[Mono-dev] problem with loading System.Windows.Forms.XplatUI on osx mono 3.0.1

Jonathan Shore jonathan.shore at gmail.com
Thu Nov 15 02:05:04 UTC 2012

I am trying to run a simple WinForms application (verified to work on windows and Linux mono 3.0.x).   For whatever reason, mono has a problem attaching to or finding the libc shared lib:

System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.DllNotFoundException: libc.dylib
  at (wrapper managed-to-native) System.Windows.Forms.XplatUI:uname (intptr)
  at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Application.EnableVisualStyles () [0x00000] in <filename unknown>:0 
  at ExecutorUI.Program.Main () [0x00000] in <filename unknown>:0 

However, libc.dylib is in the usual expected location and has both the i386 and x86_64 architectures.

$ file /usr/lib/libc.dylib 
/usr/lib/libc.dylib: Mach-O universal binary with 2 architectures
/usr/lib/libc.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/usr/lib/libc.dylib (for architecture i386):	Mach-O dynamically linked shared library i386

$ $ mono --version
Mono JIT compiler version 3.0.1 (master/301b6c6 Mon Nov  5 14:45:52 EST 2012)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug 
	LLVM:          yes(3.1svn-mono)
	GC:            Included Boehm (with typed GC)

2.10.9 does not fail, but does not completely render the app, giving a repeated error:

/Library/Frameworks/Mono.framework/Versions/2.10.9/bin/mono ExecutorUI.exe
Nov 14 21:00:30 karma.local mono[10194] <Error>: CGBitmapContextCreateImage: invalid context 0x0
Nov 14 21:00:30 karma.local mono[10194] <Error>: CGBitmapContextCreateImage: invalid context 0x0

I have not tried this on 2.10 on Linux, rather using 3.0.x.  

Ideas on how to fix the mono 3.0.1 issue?   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20121114/a1a64c97/attachment.html>

More information about the Mono-devel-list mailing list