why I cant have in my project the same namespace of an imported DLL

  • Thread starter Thread starter AA
  • Start date Start date
A

AA

I am building in VS2003 a .EXE application and the namespace of this
Application is:

Namespace MyCompany
Public Class MainClass
Public Shared Sub Main()
End Sub
End Class
End Namespace


And I have too a DLL assembly with the same Namespace


My problem is: When I change my project (.EXE) namespace with other name, I
can see the DLL namespace
... MyCompany.MyDllClass <-- OK

But if the Namespace of my project is equal to the DLL namespace I cant see
the DLL Method
.... MyCompany.MyDllClass <-- Type 'MyCompany.MyDllClass' is not defined

What that happen?

Thanks a lot
 
AA said:
I am building in VS2003 a .EXE application and the namespace of this
Application is:

Namespace MyCompany
Public Class MainClass
Public Shared Sub Main()
End Sub
End Class
End Namespace


And I have too a DLL assembly with the same Namespace


My problem is: When I change my project (.EXE) namespace with other name, I
can see the DLL namespace
... MyCompany.MyDllClass <-- OK

But if the Namespace of my project is equal to the DLL namespace I cant see
the DLL Method
... MyCompany.MyDllClass <-- Type 'MyCompany.MyDllClass' is not defined

What that happen?

We would need more information:

what "Imports" statements are in the source file?

What are the "Project Imports" in the project properties?

What is the RootNameSpace in the project properties (for both the
..exe and the .dll)

All of these thing affect either the namespace that the class is in or
the namespaces that get search for types.
 
Thanks mikeb...
what "Imports" statements are in the source file?
just... Imports System
What are the "Project Imports" in the project properties?
System.Collections
System.Data
System.Diagnostics

What is the RootNameSpace in the project properties (for both the
.exe and the .dll)
Nothing = blank

I avoid the use of RootNamespace property because in Visual Basic always
prepend to all Namespaces

So, I want that my .net and .dll (in the reference section) have the same
Namespace, in the example case: MyCompany


Thanks a lot

AA
 
AA said:
Thanks mikeb...



just... Imports System



Nothing = blank

I avoid the use of RootNamespace property because in Visual Basic always
prepend to all Namespaces

So, I want that my .net and .dll (in the reference section) have the same
Namespace, in the example case: MyCompany

The only other thing I can think of is that in the case that works you
have the .dll referenced and in the other case the .dll is not referenced.

If the references check out, I'm not sure what else I can say unless you
post code that I can actually cut-n-paste to try out. Preferably if you
can also get the same behavior when building from the command line (so
there's no question about the project settings).
 
Back
Top