name space in using visual studio?


I have both vs2008 and vs2010.

I have an application called Maxx with several projects named as
GUI, DAL, ConfigManager
I would like to have name spaces like this.
Maxx.GUI, MaxxDAL, Maxx.ConfigManager.

With C#, I do this in the properties of the VS projects.
I change the Assembly name and Default namespace.

It seems that it is a little different in

Can you help?

I would like to have a solution name, Maxx with several VB project named:
Maxx.GUI, MaxxDAL, Maxx.ConfigManager.

Also when I create a .vb page in each of those projects, I want the VS to add the namespace.
Who is Participating?
Unless you are creating additional namespaces. If you do not need any name space (single exe etc) then you don't need to specify it in code. If you want spaces like MyProject.DAL and MyProject.Presentation etc then you specify MyProject as root namespace (which it is by default) and add

Namespace DAL
NameSpace Presentation

in code files.
käµfm³d 👽Commented:
The "Default Namespace" ("Root namespace" in VB) is simply the namespace that is applied whenever you add a new item--it has no bearing on existing items. To change existing items you will have to manually open up each file and make the change (a find/replace should work as well). In Solution Explorer, you can single-click a highlighted project, or right-click the project and select "Rename" to change the name as you like.
dkim18Author Commented:
It seems that with c# project, it automatically added the namespace in the code.
But in, it doesn't seem that way. Is that right?
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

VB.NET applies the root namespace to each file and class automatically
Jacques Bourgeois (James Burger)PresidentCommented:
In VB, simply open the Project properties (Project menu).

In the Application tab, define the Root namespace such as Maxx.GUI. This becomes the namespace for the assembly (.exe or .dll).

If you want, you can even create "sub-namespaces", many namespaces inside a given project. Simply enclose all the code of the class in a Namespace structure:

Namespace Components
    Class YourClass

    End Class
End Namespace

The root namespace and the Namespace clause are appended together so that the namespace for your classe becomes Maxx.GUI.Components.YourClass
dkim18Author Commented:

Thanks for that link.
That's what I was confusing about.

So in, I should not explicitly put namespace.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.