[Mono-winforms-list] System.Windows.Forms.XplatUI ---> System.Net.Sockets.SocketException

Ben Lamb mono-winforms@zurgy.org
Mon, 2 May 2005 19:32:53 +0100


I'm trying to test Managed.Windows.Forms by compiling a simple HelloWorld 
program (listed below). Whenever I try and use Managed.Windows.Forms I get 
the following:

$ mono test.exe
Mono System.Windows.Forms Assembly [Revision: 41731; built: 2005/2/15 5:56:12]

Unhandled Exception: System.TypeInitializationException: An exception was 
thrown by the type initializer for System.Windows.Forms.XplatUI ---> 
System.Net.Sockets.SocketException: Some sort of w32 error occurred: 10049
in <0x000cb> System.Net.Sockets.Socket:Bind (System.Net.EndPoint local_end)
in <0x001fa> System.Windows.Forms.XplatUIX11:SetDisplay (IntPtr 
in <0x0008c> System.Windows.Forms.XplatUIX11:.ctor ()
in <0x0003f> System.Windows.Forms.XplatUIX11:GetInstance ()
in <0x00059> System.Windows.Forms.XplatUI:.cctor ()--- End of inner exception 
stack trace ---

in <0x00000> <unknown method>
in <0x00049> System.Windows.Forms.Form:get_CreateParams ()
in <0x0003c> System.Windows.Forms.MessageBox+MessageBoxForm:get_CreateParams 
in <0x001fc> System.Windows.Forms.Control:.ctor ()
in <0x00011> System.Windows.Forms.ScrollableControl:.ctor ()
in <0x0000c> System.Windows.Forms.ContainerControl:.ctor ()
in <0x00010> System.Windows.Forms.Form:.ctor ()
in <0x00013> 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 
in <0x0002b> System.Windows.Forms.MessageBox:Show (System.String text)
in <0x0000c> WelcomeGUI.Welcome:Main (System.String[] args)

I've installed kubuntu Linux 5.04. Initially I tried with Mono 1.1.6 and 
libgdiplus 1.1.5 both compiled from sources. When that didn't work I checked 
out today's versions of Mono and libgdiplus from subversion and built those. 
Same error.

My X Server is x.org's 6.8.2 release, gcc 3.3. I compiled mono with the .NET 
2.0 preview enabled.

Any suggestions on what might be causing this would be greatly appreciated.


Ben Lamb.

My test program:

using System;
using System.Windows.Forms;

namespace MyTest
 class TestClass
  static void Main( string[] args )
   MessageBox.Show( "Hello World!" );