Pagina 1 di 1

[RISOLTO] Problema mono e windows form

Inviato: lun 29 dic 2008, 20:34
da Szat
Ciao a tutti

ho installato mono 2.0.1 dal rep 12.2 di slacky

Ho provato a scrivere una piccola applicazione windows form che ho trovato nei tutorial ufficiali:

Codice: Seleziona tutto

using System;
using System.Drawing;
using System.Windows.Forms;
 
public class HelloWorld : Form
{
	static public void Main ()
	{
		Application.Run (new HelloWorld ());
	}
 
	public HelloWorld ()
	{
		Button b = new Button ();
		b.Text = "Click Me!";
		b.Click += new EventHandler (Button_Click);
		Controls.Add (b);
	}
 
	private void Button_Click (object sender, EventArgs e)
	{
		MessageBox.Show ("Button Clicked!");
	}
}
La compilazione tutto ok:

Codice: Seleziona tutto

gmcs -pkg:dotnet hello.cs
e crea correttamente hello.exe

PerĂ²

Codice: Seleziona tutto

mono hello.exe
mi dice:
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeEngine ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeWin32Classic ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: gdiplus.dll
at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
at System.Drawing.GDIPlus..cctor () [0x00000]
--- End of inner exception stack trace ---
at System.Drawing.KnownColors..cctor () [0x00000]
--- End of inner exception stack trace ---
at System.Drawing.Color.get_Black () [0x00000]
at System.Windows.Forms.ThemeWin32Classic..cctor () [0x00000]
--- End of inner exception stack trace ---
at System.Windows.Forms.ThemeEngine..cctor () [0x00000]
--- End of inner exception stack trace ---
at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000]
at System.Windows.Forms.Control..ctor () [0x00000]
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()
at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000]
--- End of inner exception stack trace ---
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 HelloWorld..ctor () [0x00000]
at (wrapper remoting-invoke-with-check) HelloWorld:.ctor ()
at HelloWorld.Main () [0x00000]
Qualcuno ha avuto lo stesso problema?

Grazie in anticipo

Re: Problema mono e windows form

Inviato: lun 29 dic 2008, 21:05
da gohanz
A me funziona. Hai installato le dipendenze? Vedi libgdiplus.

Immagine

Re: Problema mono e windows form

Inviato: lun 29 dic 2008, 21:14
da Szat
gohanz ha scritto:A me funziona. Hai installato le dipendenze? Vedi libgdiplus.
Ok... Mi sono abituato troppo presto a slackyd ;)
Grazie

Re: [RISOLTO] Problema mono e windows form

Inviato: lun 29 dic 2008, 21:23
da Szat
Doppiamente pirla... C'era anche sul tutorial... -__-