System.Drawing does not exist?

Viewed 62759

I'm trying to create a validation image using class library in asp.net, but that is not the question.

Anyway, my question is... well... system.drawing does not exist so I cant use "bitmap". From similar questions, people tell to add reference. But I already did that, restarted my computer etc. It doesn't work.

What can I do besides adding reference? It doesn't work or am I doing it wrong ?

Here is basically what I did:

  • Right click to references, which is under solution,
  • add reference
  • add system.drawing

But still, it does not appear in intellisense or tells me "it does not exist, try adding reference" when I type it manually.

picture

10 Answers

I had the same issue and solved it, click on the project menu, then Add reference, reference manager will open, then click on the assemblies tab, search for System.Drawing and check it then press ok. it will recognize the package or name space.

Click on the Project tab and then on Add Reference… enter image description here

Then select System.Drawing or whatever you want.

I have also encountered the same problem. I found that a console/class library project cannot add a reference to System.Drawing. When I changed to use a Window Form project, I was able to add a Bitmap with a reference to System.Drawing.

The error is because you have not added any user control to your class library project. Add a user control to your class library project, and the error will vanish.

I had same problem. I was trying to add Reference to System.Drawing.dll via System Explorer, but it didn't help me. Finally, I put cursor on the varialbe of type 'Graphics', clicked Ctrl+. or 'Alt+Enter->Refactoring' and select 'using System.Drawing'. I don't understand why and how, but it solved my problem. enter image description here

Related