Skip to content

C# MessageBox1 program

Asked Mar 23, 2007, 1:17 PM EDT2 answers
Share
LinkedInX

I am a novice to C# program. When I tried to execute the following program following error message is coming. Please anybody explain.

 

“The type or namespace name 'Windows' does not exist in the class or namespace 'System' (are you missing an assembly reference?)”

C#
using System;
using System.Windows.Forms;
public class MessageBox1
{
public static void Main()
{
MessageBox.Show("Hello!");
}
}

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    0
    you probably just need to add a reference to system.windows.forms to your project.  Right click on your project in the Solution Explorer and choose add references.  Then go down the listbox until you see System.Windows.Forms and select it.

    -Mike
    0
  • 0
    Thank you very much for your help Mike, program is working.
    Maha
    0