<namespaceimports> Type

# <namespaceimports>

Contains a collection of NamespaceImport items.

### Parameters

Attribute | Type | Description | Required
--- | --- | --- | ---
id | string | The ID used to be referenced later. | False
refid | string | The ID to use as the reference. | False

### Nested Elements:

#### <import>

Adds a NamespaceImport to the end of the collection.

Represents a namespace to import.

### Parameters

Attribute | Type | Description | Required
--- | --- | --- | ---
if | bool | Indicates if the import should be generated. | False
name | string | Deprecated. The name of the namespace to import. | False
namespace | string | The name of the namespace to import. | False
unless | bool | Indicates if the import should be not generated. | False

#### </import>

### Examples

- Define a reference with name "system.imports".

      <namespaceimports id="system.imports">
          <import namespace="System" />
          <import namespace="System.Data" />
      </namespaceimports>

  Use the predefined set of imports to compile a VB.NET assembly.

      <vbc target="exe" output="HelloWorld.exe" rootnamespace="HelloWorld">
          <imports refid="system.imports" />
          <sources>
              <include name="**/*.vb" />
          </sources>
          <references>
              <include name="System.dll" />
              <include name="System.Data.dll" />
          </references>
      </vbc>

### Requirements

Assembly: NAnt.DotNetTasks (0.92.4543.0)