- Open the Imports panel.
- In the Enter or Select namespace field, start typing the namespace that interest you. Note that suggestions are provided while you type, in case you are not exactly sure what you are looking for.
- (Optional) Click the drop-down arrow to view and browse all available namespaces.
- Select the desired namespace. The namespace is added to the Imported Namespaces list.
Whenever you add a web service to a library project or install a new dependency to your project, either a
.nupkg file from Manage Packages default feeds or a custom library that you've created, the namespace can be imported from the Project panel as well.
Simply right-click the dependency or web service in the tree, and select Import Namespaces. The namespaces are automatically added to your project, you can check them in the Imports panel.
To remove a namespace, in the Imports panel, either right-click the namespace and select Delete, or select the namespace and press the Delete key.
To remove all the namespaces that are not used anywhere in the current file, select Remove Unused > Imports in the Studio ribbon.
Note that namespaces can only be removed if they aren't used. For example, you can remove a namespace from the project if the assembly that contains it is no longer referenced by the project.
Updated about a month ago