Reputation: 15817
I am trying to introduce namespaces to a solution.
I have three projects in one solution:
Business Logic Layer
Data Access Layer
User Interface Layer
The namespaces of the classes in the business logic layer and data access layer are as follows:
companyname.applicationname.layername
If I want to access a class in the Data Logic Layer then I have to include the following statement:
Imports DataAccessLayer.companyname.applicationname.layername
I don't want to have DataAccessLayer as the first node. Is there a way around this or am I misunderstanding something fundamental about namespaces?
Upvotes: 0
Views: 68
Reputation: 8072
First you need to define that class inside the desired namespace like,
Namespace companyname.applicationname
Public Class layername
End Class
End Namespace
Or can make default namespace by changing property,
Upvotes: 0
Reputation: 16144
For Namespace Naming Guidelines Check this:
Try setting: Assembly Name & Default Namespace
Upvotes: 2
Reputation: 422
I'm not entirely sure of exactly what you're after, but here's a few options:
Import DataAccessLayer, then referring to the sub-namespaces directly:
Imports DataAccessLayer
...
companyname.applicationname.layername.mymethod(abc)
Make your assembly namespace in the project properties "DataAccessLayer". Then you won't need to import DataAccessLayer, just import companyname... or refer to companyname... directly.
Upvotes: 0