Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cant import a namespace

Status
Not open for further replies.

jherek

Technical User
Nov 16, 2003
15
GB
I am trying to follow a tutorial that was written using the command line compiler. I have Visual Studio.

The tutorial makes two files - the first is a dll.
The second uses the dll - and Imports the namespace created in the dll.
Trouble is, when I try to do it I just get errors...

Namespace or type 'Greeting' for the Imports 'Greeting' cannot be found.

I have tried to add it by doing Project->Properties->Imports and also by adding a reference path to the folder where the original file was created. But no luck :(

Anyone know what I have to do?
 
After adding the reference to the original dll, I would look in the Object Browser to see what the namespace is for your referenced dll. I would guess, that if your references are defined properly, the problem is that the Namespace is not defined properly in the referenced dll.
 
Thanks for the reply.

I have found out how to do it now. The book says to save the dll file as 'hello.vb'. Inside this the namespace 'Greeeting' is declared. When the file is built the dll is called hello.dll, but of course, when I try to import this, the Greeting namespace isn't visible.

I had to save the dll file as Greeting, then the build created the correctly named Greeting.dll, which I could reference and thus import properly.

The point is though, as a complete novice I bought the book so I wouldn't have to find these things out! I just wanted to learn how to program - not the details of how the compilation process works. Never mind...

 
Thats what "learning how to program" is.

Welcome to the abyss. ;)

DotNetDoc
M.C.S.D.
---------------------------------------

Tell me and I forget. Show me and I remember. Involve me and I understand.
- Anonymous Chinese Proverb
-----------------------------------
If you can't explain it simply, you don't understand it well enough.
- A. Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top