[Mono-list] Cannot run C# WinForms on Mac OS X

aautar aautar at gmail.com
Wed Mar 10 20:41:46 EST 2010


Hey guys,

I'm having a similar issue with a WinForms app compiled on VC# 2008. What's
really puzzling is that it works fine on my Mac w/ OS X 10.5.8 and Mono
2.6.1, but fails on my friend's Mac which has the same config (same version
of OS X and Mono).

First, he got the following,

  at (wrapper managed-to-native)
System.Windows.Forms.CarbonInternal.Dnd.InstallTrackingHandler
(System.Windows.Forms.CarbonInternal.DragTrackingDelegate,intptr,intptr)
<0x000e0>
  at (wrapper managed-to-native)
System.Windows.Forms.CarbonInternal.Dnd.InstallTrackingHandler
(System.Windows.Forms.CarbonInternal.DragTrackingDelegate,intptr,intptr)
<0xffffffff>
  at System.Windows.Forms.CarbonInternal.Dnd..cctor () <0x00088>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
  at System.Windows.Forms.XplatUICarbon.Initialize () <0xffffffff>
  at System.Windows.Forms.XplatUICarbon.Initialize () <0x00468>
  at System.Windows.Forms.XplatUICarbon..ctor () <0x000ac>
  at System.Windows.Forms.XplatUICarbon.GetInstance () <0x00074>
  at System.Windows.Forms.XplatUI..cctor () <0x00194>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
  at System.Windows.Forms.Application.EnableVisualStyles () <0xffffffff>
  at System.Windows.Forms.Application.EnableVisualStyles () <0x0003c>
  at firesync.Program.Main (string[]) <0x00104>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object
(object,intptr,intptr,intptr) <0xffffffff>


so I simply removed Application.EnableVisualStyles(), but then got an
exception and stacktrace identical to the OP,

  at (wrapper managed-to-native) System.Drawing.GDIPlus.GdiplusStartup
(ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
<0x000e0>
  at (wrapper managed-to-native) System.Drawing.GDIPlus.GdiplusStartup
(ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
<0xffffffff>
  at System.Drawing.GDIPlus..cctor () <0x00218>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
  at System.Drawing.KnownColors..cctor () <0xffffffff>
  at System.Drawing.KnownColors..cctor () <0x00070>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
  at System.Drawing.Color.get_Black () <0xffffffff>
  at System.Drawing.Color.get_Black () <0x00028>
  at System.Windows.Forms.ThemeWin32Classic..cctor () <0x0001c>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
  at System.Windows.Forms.ThemeEngine..cctor () <0xffffffff>
  at System.Windows.Forms.ThemeEngine..cctor () <0x000dc>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
  at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined ()
<0xffffffff>
  at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined ()
<0x0001c>
  at System.Windows.Forms.Control..ctor () <0x00258>
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control..ctor
() <0xffffffff>
  at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor ()
<0x00040>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
  at System.Windows.Forms.Control..ctor () <0xffffffff>
  at System.Windows.Forms.Control..ctor () <0x00080>
  at System.Windows.Forms.ScrollableControl..ctor () <0x00024>
  at System.Windows.Forms.ContainerControl..ctor () <0x00038>
  at System.Windows.Forms.Form..ctor () <0x0005c>
  at firesync.WinFormsUI.EulaForm..ctor () <0x00034>
  at (wrapper remoting-invoke-with-check) firesync.WinFormsUI.EulaForm..ctor
() <0xffffffff>
  at firesync.Program.Execute (string[],bool) <0x0125c>
  at firesync.ProgramEntry.Main (string[]) <0x00060>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object
(object,intptr,intptr,intptr) <0xffffffff> 



mono-test-install gives the following on both my Mac and my friend's:

Active Mono: /usr/bin/mono
Warning: pkg-config could not find mono installed on this system
No dotnet pkgconfig found, Windows.Forms, System.Drawing and others will not
work 

Despite the warning, my mono install seems to function perfectly (I did an
uninstall + reinstall and still got the warning). If it could be a factor on
my friend's Mac, how do I resolve it?

Any other thoughts, help, etc. greatly appreciated.

-- Avishkar

-- 
View this message in context: http://n4.nabble.com/Cannot-run-C-WinForms-on-Mac-OS-X-tp1565987p1588331.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list