MAC: Mono Helloworld example

I did a fresh install of Mono on my OSX Yosemite and tried examples at http://www.mono-project.com/docs/getting-started/mono-basics/ .

The Hello World console example works without issue, but when I tried WindowsForm Hello World I got the following error:

System.EntryPointNotFoundException: GdipCreateFromContext_macosx at (wrapper managed-to-native) System.Drawing.GDIPlus:GdipCreateFromContext_macosx (intptr,int,int,intptr&)
  at System.Drawing.Graphics.FromHwnd (IntPtr hwnd) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUICarbon.PaintEventStart (System.Windows.Forms.Message& msg, IntPtr handle, Boolean client) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUI.PaintEventStart (System.Windows.Forms.Message& msg, IntPtr handle, Boolean client) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ScrollableControl.  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0 
Chads-MacBook-Pro:C# ChadLeong$ mono hello.exe
System.EntryPointNotFoundException: GdipCreateFromContext_macosx
  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdipCreateFromContext_macosx (intptr,int,int,intptr&)
  at System.Drawing.Graphics.FromHwnd (IntPtr hwnd) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUICarbon.PaintEventStart (System.Windows.Forms.Message& msg, IntPtr handle, Boolean client) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUI.PaintEventStart (System.Windows.Forms.Message& msg, IntPtr handle, Boolean client) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0 

      

Anyone got it? Thank!

+3


source to share


1 answer


This is a known bug / regression in the 3.10 release: https://bugzilla.xamarin.com/show_bug.cgi?id=23553



This Xamarin forum thread provides a fix version: http://forums.xamarin.com/discussion/27011/fix-for-gdipcreatefromcontext-macosx-and-other-macios-gdi-issues

+4


source







All Articles