You are not logged in.

#1 2007-12-09 12:07:10

subset
Member
From: Hungary
Registered: 2007-10-18
Posts: 10

monodevelop C# error

Hi !

I get this message, when I want use System.Drawing and System.Windows.Forms
latest mono,monodevelop,gtk-sharp etc.
Code:

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!");
    }
}

Error message:

(2,7): error CS0234: The type or namespace name `Drawing' does not exist in the namespace `System'. Are you missing an assembly reference?
(2,1): error CS0246: The type or namespace name `System.Drawing' could not be found. Are you missing a using directive or an assembly reference?
(3,7): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
(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?


Build complete -- 4 errors, 0 warnings

---------------------- Done ----------------------

ERROR: MonoDevelop could not find the Gtk# 2.0 development package. Compilation of projects depending on Gtk# libraries will fail. You may need to install development packages for gtk-sharp-2.0.

Build: 4 errors, 0 warnings

thx

Last edited by subset (2007-12-09 20:37:07)

Offline

#2 2007-12-21 03:11:17

sebleblanc
Member
From: Montréal, Canada
Registered: 2007-12-21
Posts: 41

Re: monodevelop C# error

Try downloading the Gtk# 2.0 devel package.


Also, C# sucks. smile

Offline

Board footer

Powered by FluxBB