Visual Basic Compiler Options |
|
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
- Open the project's Property Pages dialog box. For details, see <Projectname> Property Pages Dialog Box.
- Click the Common Properties folder.
- Click the General property page.
- Modify the Root Namespace property.
To set /rootnamespace programmatically
- See DefaultNamespace Property (Visual Basic and C# Project Object) and DefaultNamespace Property (Visual Basic and Visual C# ProjectItem Object).
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