[Mono-winforms-list] All WinForms Projects Crash on Startup

Ken Koch kkoch at centralert.com
Mon May 19 18:17:57 EDT 2008


I am using VS 2005 or using gmcs to try to create the simplest possible
WinForms application and run it under Mono on Windows in preparation for a
Mac port.  Basically I create an empty WinForms project without any changes.
I always get the following:

 

 

Unhandled Exception: System.TypeInitializationException: An exception was
thrown by the type initializer for
System.Windows.Forms.WindowsFormsSynchronizationContext --->
System.NullReferenceException:

 Object reference not set to an instance of an object

at (wrapper native-to-managed)
System.Windows.Forms.XplatUIWin32.InternalWndProc
(intptr,System.Windows.Forms.Msg,intptr,intptr) <0x00000>

at (wrapper managed-to-native)
System.Windows.Forms.XplatUIWin32.Win32CreateWindow
(System.Windows.Forms.WindowExStyles,string,string,System.Windows.Forms.Wind
owStyles,int,int,int,int,intptr,intptr,in

tptr,intptr) <0x00004>

at System.Windows.Forms.XplatUIWin32.CreateWindow
(System.Windows.Forms.CreateParams) [0x000a1] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-1.9.1\mcs\class\Managed.Windows.For
ms\System.Windows.Forms\X

platUIWin32.cs:1588

at System.Windows.Forms.XplatUI.CreateWindow
(System.Windows.Forms.CreateParams) [0x00000] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-1.9.1\mcs\class\Managed.Windows.For
ms\System.Windows.Forms\XplatU

I.cs:475

at System.Windows.Forms.NativeWindow.CreateHandle
(System.Windows.Forms.CreateParams) [0x0000c] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-1.9.1\mcs\class\Managed.Windows.For
ms\System.Windows.Forms\N

ativeWindow.cs:112

at System.Windows.Forms.Control.CreateHandle () [0x0003f] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-1.9.1\mcs\class\Managed.Windows.For
ms\System.Windows.Forms\Control.cs:4375

at System.Windows.Forms.Control.CreateControl () [0x00044] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-1.9.1\mcs\class\Managed.Windows.For
ms\System.Windows.Forms\Control.cs:3711

at (wrapper remoting-invoke-with-check)
System.Windows.Forms.Control.CreateControl () <0x00036>

at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor ()
[0x0000a] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-1.9.1\mcs\class\Managed.Windows.For
ms\System.Windows.Forms\WindowsFormsSynchr

onizationContext.cs:47

--- End of inner exception stack trace ---

 

Command line applications work fine.   Presumably this is some sort of setup
issue, but any help would be appreciated.  

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20080519/e14d55c7/attachment-0001.html 


More information about the Mono-winforms-list mailing list