Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual Basic
 /imports

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual Basic Language Reference 
/imports (Visual Basic) 

Imports namespaces from a specified assembly.

/imports:namespaceList
namespaceList

Required. Comma-delimited list of namespaces to be imported.

The /imports option imports any namespace defined within the current set of source files or from any referenced assembly.

The members in a namespace specified with /imports are available to all source-code files in the compilation. Use the Imports Statement to use a namespace in a single source-code file.

To set /imports in the Visual Studio integrated development environment

  1. Have a project selected in Solution Explorer. On the Project menu, click Properties. For more information, see Introduction to the Project Designer.

  2. Click the References tab.

  3. Enter the namespace name in the box beside the Add User Import button.

  4. Click the Add User Import button.

The following code compiles when /imports:system is specified.

Visual Basic
Module MyModule
    Sub Main()
        Console.WriteLine("test")
        ' Otherwise, would need
        ' System.Console.WriteLine("test")
    End Sub
End Module
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker