Visual Basic Compiler Options  

/rootnamespace

Specifies a namespace for all type declarations.

/rootnamespace:namespace

Arguments

namespace
The name of the namespace in which to enclose all type declarations for the current project.

Remarks

If you use the Visual Studio executable (Devenv) to compile a project created in the Visual Studio integrated development environment, /rootnamespace lets you specify the value of the RootNamespace property. See Devenv Command Line Switches for more information.

Use the common language runtime MSIL Disassembler (ildasm.exe) to view the namespace names in your output file.

To set /rootnamespace in the Visual Studio integrated development environment

  1. Open the project's Property Pages dialog box. For details, see <Projectname> Property Pages Dialog Box.
  2. Click the Common Properties folder.
  3. Click the General property page.
  4. Modify the Root Namespace property.

To set /rootnamespace programmatically

Example

The following code compiles in.vb and encloses all type declarations in the namespace mynamespace:

vbc /rootnamespace:mynamespace in.vb

See Also

Visual Basic Compiler Options | MSIL Disassembler (Ildasm.exe) | Sample Compilation Command Lines