Accessing a class in a console application

  • Thread starter Thread starter John McMahon
  • Start date Start date
J

John McMahon

I am a casual programmer learning the C# language.
I have been going thru the examples in a book on the language.
This particular example, which is a console application, calls for a using
statement including the System.Windows.Forms class.
Although I know the class is there since I have seen it automatically
generated for a Windows forms application, it somehow is not picked up by
the Console application.
There is probably a simple solution for this and I would appreciate it if
someone would relay it to me.
 
Hi John,
I'm not quite sure what your problem is, but when you compile that console
application did you specify the System.Windows.Forms.dll assembly as a
referenced assembly to the compiler. I don't know how you compile your
programs. Do you use VS .NET or you use command-line compiler?

Reading your post I am taking you use VS.NET; right click on references node
for the project in the *solution explorer* utility, select *Add
reference...* from the menu and then add System.Windows.Forms.dll from the
list.

HTH
B\rgds
100
 
Back
Top