E
Epetruk
Hello,
I have a solution with two projects.
One of the projects is called MyProj with a root namespace called
MyProj.Obj.
The single source (vb) file for MyProj has a class called Obj. There is no
enclosing namespace, i.e. the class declaration is at the top of the file.
The second project is called MyProjUser and has a reference to MyProj.
The single source file for MyProjUser has the following imports statement:
Imports MyProj.Obj
Then I have a statement further down in MyProjUser like this:
Dim o as Obj
But the compiler doesn't like it. It says that Obj isn't defined.
The compiler is happier when I either have this Imports statement:
Imports MyProj.Obj.Obj
or with this statement in code:
Dim o as Obj.Obj.
What's happening here? I thought that once I imported the namespace (in this
case MyObj.Obj), then all classes in that namespace (including Obj) should
be usable without further qualification.
Or is the fact that part of the namespace and the class name are the same
(i.e. Obj) causing confusion?
TIA for any answers.
I have a solution with two projects.
One of the projects is called MyProj with a root namespace called
MyProj.Obj.
The single source (vb) file for MyProj has a class called Obj. There is no
enclosing namespace, i.e. the class declaration is at the top of the file.
The second project is called MyProjUser and has a reference to MyProj.
The single source file for MyProjUser has the following imports statement:
Imports MyProj.Obj
Then I have a statement further down in MyProjUser like this:
Dim o as Obj
But the compiler doesn't like it. It says that Obj isn't defined.
The compiler is happier when I either have this Imports statement:
Imports MyProj.Obj.Obj
or with this statement in code:
Dim o as Obj.Obj.
What's happening here? I thought that once I imported the namespace (in this
case MyObj.Obj), then all classes in that namespace (including Obj) should
be usable without further qualification.
Or is the fact that part of the namespace and the class name are the same
(i.e. Obj) causing confusion?
TIA for any answers.