The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.


Specifies a namespace for all type declarations.



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


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

  • See DefaultNamespace Property (Visual Basic and C# Project Object) and DefaultNamespace Property (Visual Basic and Visual C# ProjectItem Object).


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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft