Import Namespace

Imports the appropriate namespace and assembly reference for the identifier at the caret. If several assemblies contain a class or namespace with the same name as the class or namespace at the caret, the code provider enables you to choose the required assembly from the smart tag sub menu.

Availability

From the context menus or via shortcuts:

  • when the edit cursor or caret is on a link to an assembly not included in the current project references list or on a reference to a class contained in a non-referenced assembly.

Example

Note

The code provider will be available in the following sample code if the System.Drawing namespace is excluded from the project references list.

System.Rectangle Myrect = new Rectangle();
Dim MyRect As System.Rectangle = New Rectangle()