[Mono-list] Windows.Forms not found

Maser, Dan Dan.Maser at inin.com
Fri Jul 6 10:27:06 EDT 2007


  You need to add the reference to System.Windows.Forms just like you
did System.Drawing.  Such as "mcs -r:System.Drawing
-r:System.Windows.Forms sample.cs" 

-----Original Message-----
From: mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Mladen Bestvina
Sent: Monday, July 02, 2007 4:51 PM
To: mono-list at lists.ximian.com
Subject: [Mono-list] Windows.Forms not found

Hello!

The compilation of the code below fails, apparently because 
Windows.Forms cannot be found on the system. I do have 
Windows.Forms.dll. I am using Ubuntu Feisty Fawn and I installed mono 
from ubuntu packages.

Any advice is appreciated.

Mladen

=================================

mb at hvar:~/mono$ mcs -r:System.Drawing sample.cs
sample.cs(3,7): error CS0234: The type or namespace name `Windows' does 
not exist in the namespace `System'. Are you missing an assembly
reference?
sample.cs(3,1): error CS0246: The type or namespace name `Windows.Forms'

could not be found. Are you missing a using directive or an assembly 
reference?
Compilation failed: 2 error(s), 0 warnings



===========================================

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!");
}
}
_______________________________________________
Mono-list maillist  -  Mono-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list




More information about the Mono-list mailing list