Skip to content

Commit a6a26b1

Browse files
Merge pull request #13911 from MicrosoftDocs/ghogen-patch-701054
Update procedure for VB Import namespaces
2 parents dbde096 + c8eea60 commit a6a26b1

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

docs/ide/how-to-add-or-remove-imported-namespaces-visual-basic.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Add or remove imported namespaces (Visual Basic)
33
description: Add or remove imported Visual Basic namespaces and add, remove, or update user imports with the Project Designer in Visual Studio.
4-
ms.date: 06/21/2017
4+
ms.date: 5/6/2025
55
ms.topic: how-to
66
helpviewer_keywords:
77
- adding imported namespaces
@@ -22,9 +22,9 @@ Imported namespaces are managed on the **References** page of the **Project Desi
2222

2323
### To add an imported namespace
2424

25-
1. In **Solution Explorer**, double-click the **My Project** node for the project.
25+
1. In **Solution Explorer**, right-click the project node and select **Properties**, or press **Alt**+**Enter**.
2626

27-
2. In the **Project Designer**, click the **References** tab.
27+
2. In the **Project Designer**, go to **References**.
2828

2929
3. In the **Imported Namespaces** list, select the check box for the namespace that you wish to add.
3030

@@ -33,9 +33,9 @@ Imported namespaces are managed on the **References** page of the **Project Desi
3333
3434
### To remove an imported namespace
3535

36-
1. In **Solution Explorer**, double-click the **My Project** node for the project.
36+
1. In **Solution Explorer**, right-click the project node, and select **Properties**, or press **Alt**+**Enter**.
3737

38-
2. In the **Project Designer**, click the **References** tab.
38+
2. In the **Project Designer**, go to **References**.
3939

4040
3. In the **Imported Namespaces** list, clear the check box for the namespace that you wish to remove.
4141

@@ -46,9 +46,9 @@ If you later change you mind and decide that was really the `EventLog` class tha
4646

4747
### To add a user import
4848

49-
1. In **Solution Explorer**, double-click the **My Project** node for the project.
49+
1. In **Solution Explorer**, right-click the project node, and select **Properties**, or press **Alt**+**Enter**.
5050

51-
2. In the **Project Designer**, click the **References** tab.
51+
2. In the **Project Designer**, go to **References**.
5252

5353
3. In the text box below the **Imported Namespaces** list, enter the full name for the namespace you wish to import, including the root namespace.
5454

@@ -59,16 +59,30 @@ If you later change you mind and decide that was really the `EventLog` class tha
5959
6060
### To update a user import
6161

62-
1. In **Solution Explorer**, double-click the **My Project** node for the project.
62+
1. In **Solution Explorer**, right-click the project node, and select **Properties**, or press **Alt**+**Enter**.
6363

64-
2. In the **Project Designer**, click the **References** tab.
64+
2. In the **Project Designer**, go to **References**.
6565

6666
3. In the **Imported Namespaces** list, select the namespace you wish to change.
6767

6868
4. In the text box below the **Imported Namespaces** list, enter the name for the new namespace.
6969

7070
5. Click the **Update user import** button to update the namespace in the **Imported Namespaces** list.
7171

72+
## In the project file
73+
74+
As you make changes in the Project Designer, the project file is updated to reflect your changes. The imported namespaces appear in the project file as shown in the following code:
75+
76+
```xml
77+
<ItemGroup>
78+
<Import Include="System.Collections.Specialized" />
79+
<Import Include="System.ComponentModel" />
80+
<Import Include="System.Web" />
81+
<Import Include="System.Windows.Markup" />
82+
<Import Include="System.Xml" />
83+
</ItemGroup>
84+
```
85+
7286
## Related content
7387

7488
- [Manage references in a project](../ide/managing-references-in-a-project.md)

0 commit comments

Comments
 (0)