views:

400

answers:

3

I created a console application, but I want to turn it into a windows forms application.

I found This and it appeared to be what I needed, but I got an error message when I tried to use using System.Windows.Forms;

This is the error message I got:

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

Is there another step, or is it somehow different in VS 2008?

+2  A: 

You need to add a reference to System.Windows.Forms. Right-click your project and choose Add Reference.

On the .NET tab choose the the previously mentioned reference.

João Angelo
+6  A: 

You need to add a reference to the WinForms assembly

  • Right click on the solution and select "Add Reference"
  • Select System.Windows.Forms and hit OK

You may need to do the same for System.Data as well depending on your project setup

JaredPar
Thanks. This worked. And for System Data, you mean add a reference to it?
Slateboard
@Slateboard yes
JaredPar
+3  A: 

Make sure you add the System.Windows.Forms assembly in your references for the project. In the solution explorer, right click on 'References' and then under the .NET tab find the System.Windows.Forms assembly and add it.

Bryan Rowe