[Mono-osx] Cannot make Windows.Forms Hello World run on OSX

Don Edvalson don at edvalson.net
Fri Jan 13 10:09:05 EST 2006


Hi all,

I am an fairly experienced .NET programmer who is new to mono and macs.

I have been trying for two days now to get a basic Hello World app 
running on OSX Tiger. In spite of numerous permutations and attempts, I 
have not been able to do so. I would really appreciate any advice or 
suggestions.

The steps I followed were:

1.   Install new copy of OSX on the machine including X11
2.   Install the current binary version of Mono from the site (1.1.13)
3.   Wrote the following basic application.

*********************
using System;
using System.Windows.Forms;

public class test
{
        public static void Main()
        {
                MessageBox.Show("Hello World");
        }
}
****************************

4. Compiled it using:

    mcs hello.cs /r:System.Windows.Forms.dll /out:hello.exe
    macpack -n:hello -a:hello.exe -o:. -m:1

Ran it by double clicking on it in the Finder.

It appeared on the dashboard for a moment, then disappeared. The 
following appeared on the console: 

 
===== Friday, January 13, 2006 9:53:52 AM US/Eastern =====

Mono System.Windows.Forms Assembly [Revision: 54007; built: 2005/12/6 
14:35:24]

 
Unhandled Exception: System.TypeInitializationException: An exception 
was thrown by the type initializer for System.Windows.Forms.XplatUI ---> 
System.NotImplementedException: The requested feature is not implemented.

in <0x0002c> System.Windows.Forms.XplatUIOSX:ClipboardOpen ()

in <0x0002c> System.Windows.Forms.XplatUI:ClipboardOpen ()

in <0x00030> System.Windows.Forms.DataFormats:Init ()

in <0x00050> System.Windows.Forms.DataFormats:GetFormat (Int32 ID)

in <0x000e8> System.Windows.Forms.XplatUI:.cctor ()--- End of inner 
exception stack trace ---


Thanks,

Don

 

in <0x00000> <unknown method>

in <0x0008c> System.Windows.Forms.Form:get_CreateParams ()

in <0x00088> System.Windows.Forms.Form:get_CreateParams ()

in <0x00044> 
System.Windows.Forms.MessageBox+MessageBoxForm:get_CreateParams ()

in <0x00370> System.Windows.Forms.Control:.ctor ()

in <0x00028> System.Windows.Forms.ScrollableControl:.ctor ()

in <0x0001c> System.Windows.Forms.ContainerControl:.ctor ()

in <0x0002c> System.Windows.Forms.Form:.ctor ()

in <0x0003c> System.Windows.Forms.MessageBox+MessageBoxForm:.ctor 
(IWin32Window owner, System.String text, System.String caption, 
MessageBoxButtons buttons, MessageBoxIcon icon)

in (wrapper remoting-invoke-with-check) MessageBoxForm:.ctor 
(System.Windows.Forms.IWin32Window,string,string,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)

in <0x00054> System.Windows.Forms.MessageBox:Show (System.String text)

in <0x00014> test:Main ()



More information about the Mono-osx mailing list