Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 12th, 2004, 12:52 PM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drawing in C#

I have been trying to write a drawing program and the problem I have encountered is that when I enter the using statement, using System.Drawing; the following error occurs:
The type or namespace name 'Drawing' does not exist in the class or namespace 'System' (are you missing an assembly reference?)

COuld anyone tell me what the problem is?

Nicola


 
Old April 12th, 2004, 01:42 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

To quote the error message "are you missing an assembly reference?" How are you compiling this? If you are in VS.net do you have a reference in the project to the System.Drawing assembly? If you are compiling with the command line, are you including a reference to that assembly in the reference options?

Peter
-------------------------
Work smarter, not harder
 
Old April 13th, 2004, 12:46 PM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using VS .NET

I tried the example Creating a Graphics Path from Chp 16 in "Beginning Visual C#". This worked fine.

However if I try to use Using System.Drawing directives in a non-Windows application (Console Application) I get the error. In fact if I type the dot operator after System, I don't even get "Drawing" coming up on the pop-up list. I was hoping to print out from my program and do not require Windows form, do I have to use a Windows application for this? Just wondering?

Thanks

Nicola



 
Old July 27th, 2004, 10:54 AM
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
This reply may be a little late going by the date you posted, hopefully you have figured out what was wrong, but this may still help some other people as I have seen this question posted on forums all over the net. Basicly as Planoe said, you have to add a reference to the assembly. To do this in your solution, on the top menu go to project->Add Reference

then scroll down and select the system.drawing.dll, you will now be able to declare using System.Drawing; in your console application.

I was also working from a book that failed to mention this to me, the book gave the impression that System.Drawing could just be declared and used, possibly it has been removed from a console apps standard References since our books were published.

Thanks Planoe, and this helps someone.

Gav
 
Old August 25th, 2004, 10:01 AM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the replies.

I did manage to find out the solution to this problem elsewhere, but the answer may prove useful to someone else.

Thanks

Nicola







Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing Shapes cbulutlar Javascript 2 March 6th, 2006 02:25 PM
drawing fergo Access VBA 0 June 6th, 2005 12:35 PM
drawing fergo BOOK: Access 2003 VBA Programmer's Reference 1 June 5th, 2005 09:32 AM
drawing with VBA cutovoi Excel VBA 1 February 19th, 2004 07:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.