Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type or namespace name 'Windows' does not exist in the namespace 'System'

I am trying to code for pop up message box for displaying message for successful record insertion in C#.net

Error :

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

Code :

 global::System.Windows.Forms.MessageBox.Show("Test");
like image 214
blue Avatar asked Feb 01 '13 06:02

blue


People also ask

How do you fix the type or namespace name could not be found?

The solution in this case is to either upgrade the framework target of the application (Project A), or downgrade the target of referenced assembly (Project B).

How do I fix cs0234 error?

To fix this error, simply update the example . csproj file to use a previous System. CommandLine version. Note that this package is only used to parse the options for the example.


1 Answers

If you are using MS Visual Studio:

  1. Right click on the Project
  2. Select "Add Reference..."
  3. Navigate to the ".NET" tab
  4. Find "System.Windows.Forms" and select it
  5. Click OK.

P. S.: Additionally, I had to do the same with "System.Drawing" for everything to work correctly in my first GUI Windows program.

like image 58
Dmytro Dzyubak Avatar answered Oct 15 '22 15:10

Dmytro Dzyubak