Accessing a class in a console application


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


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question