Root Namespaces

Posted Sat, Jul 24 2004 18:34 by bill

Although the general guideline for Namespaces is you use your company name followed by the technology name, e.g.  Ajax.Widgets , Visual Studio .NET doesn’t actually tend to accommodate that by default. Instead, you have to open the project properties and modify the root namespace each time you create a new project.  Hopefully one day they will fix that, and have an Options setting where you can specify the default root namespace to use. Until then here’s a quick fix for VB.NET 2003 …

Locate the common.js file in the VBWizards directory, e.g. :
C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\VBWizards\1033\ common.js

Next open that file and locate the CreateVSProject function. It should be the fist one there.  At the end of that function, you should see :

    return project;

Change that to:

    project.Properties("RootNamespace").Value = "Ajax." + strProjectName ;
    return project;

Now next time you create a new project, “Ajax” will be the root namespace.  Of course you should change “Ajax” to your own company name ;)

Enjoy J

Filed under:


# Root namespaces

Monday, July 26, 2004 1:03 AM by TrackBack