[Mono-winforms-list] OS X Trouble

Ryan Sommers rpsommers at gmail.com
Fri Dec 1 17:32:15 EST 2006


So far I've been unable to get Mono 1.2 + MWF to work without X11 running.
To test I've been using the following code:

###########
using System;
using System.Windows.Forms;

namespace RPS
{
    class Program
    {
        public static void Main(string[] args)
        {
            Application.Run(new Form());
        }
    }
}
############

Under X11 a blank form pops up. However, if I just run the app without X11
running I get this in the console:

Unhandled Exception: System.TypeInitializationException: An exception was
thrown by the type initializer for System.Windows.Forms.XplatUI --->
System.ArgumentNullException: Could not open display (X-Server required.
Check you DISPLAY environment variable)
Parameter name: Display
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle)
[0x00000]
  at System.Windows.Forms.XplatUIX11..ctor () [0x00000]
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000]
  at System.Windows.Forms.XplatUI..cctor () [0x00000] --- End of inner
exception stack trace ---

  at <0x00000> <unknown method>
  at System.Windows.Forms.Form.get_CreateParams () [0x00000]
  at System.Windows.Forms.Form.get_CreateParams () [0x00000]
  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 (wrapper remoting-invoke-with-check) System.Windows.Forms.Form:.ctor ()
  at RPS.Program.Main (System.String[] args) [0x00000]

Program is compiled, packed and run with: mcs /r: System.Windows.Forms.dll
client.cs && macpack client.exe && open client.app
Mono 1.2 was downloaded and installe via the package: Mono C# compiler
version 1.2.1.0

Any help would be appreciated.

Thanks


-- 
Ryan P Sommers
rpsommers at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20061201/b9caed76/attachment.html 


More information about the Mono-winforms-list mailing list