VB.Net – “…any public member or cannot be found…” message

Posted on Wednesday, March 30th, 2011 at 8:20 pm in

So I’m playing around with Visual Basic in VisualStudio 2010 Express and I’m planning on importing some code from an old VB file I squirrelled away a while ago. I create my project and define a new class and then copy/paste out of the old code. Intellisence immediately squawks and I get the message “The Namespace or type specified in the Imports ‘System.Drawing’ doesn’t contain any public member or cannot be found.” Great.

A search in MSDN is fruitless but eventually I stumble upon a posting with exactily what I needed to know.

I need to add a reference to the class library. Go to Project > Add Reference and choose the .NET tab. Scroll down to the System.Drawing entry (or whatever you are using) and then add it.

You might also be interested in

Top