You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use the Reference Manager dialog box to add and manage references to components that you, Microsoft, or another company developed. If you're developing a Universal Windows app, your project automatically references all of the correct Windows SDK DLLs. If you are developing a .NET application, your project automatically references *mscorlib.dll*. Some .NET APIs are exposed in components that you have to add manually. References to COM components or custom components have to be added manually.
32
+
You can use the Reference Manager dialog box to add and manage references to components that you, Microsoft, or another company developed. If you're developing a Universal Windows app, your project automatically references all of the correct Windows SDK DLLs. If you're developing a .NET application, your project automatically references *mscorlib.dll*. Some .NET APIs are exposed in components that you have to add manually. References to COM components or custom components have to be added manually.
33
33
34
34
## Reference Manager dialog box
35
35
36
36
The Reference Manager dialog box shows different categories on the left side, depending on the project type:
37
37
38
-
-**Assemblies**, with **Framework** and **Extensions** subgroups
38
+
-**[Assemblies](#assemblies-tab)**, with **Framework** and **Extensions** subgroups
39
39
40
-
-**COM** lists all COM components that are available for referencing
40
+
-**[COM](#com-tab)** lists all COM components that are available for referencing
41
41
42
-
-**Projects**
42
+
-**[Projects](#projects-tab)**
43
43
44
-
-**Shared Projects**
44
+
-**[Shared Projects](#shared-projects-tab)**
45
45
46
-
-**Windows**, with **Core** and **Extensions** subgroups. You can explore the references in the Windows SDK or extension SDKs by using the **Object Browser**.
46
+
-**[Windows](#universal-windows-tab)**, with **Core** and **Extensions** subgroups. You can explore the references in the Windows SDK or extension SDKs by using the **Object Browser**.
47
47
48
-
-**Browse**, with **Recent** subgroup
48
+
-**[Browse](#browse)**, with **Recent** subgroup
49
49
50
50
> [!NOTE]
51
51
> You might not see **Browse** in the Reference Manager dialog box if you're developing C++ projects.
52
52
53
53
## Add a reference
54
54
55
-
1. In **Solution Explorer**, right-click on the **References** or **Dependencies** node and choose either **Add Project Reference**, **Add Shared Project Reference**, or **Add COM Reference**. (You can right-click the project node and select **Add** from the fly-out menu to choose from these options, too.)
55
+
1. In **Solution Explorer**, right-click the **References** or **Dependencies** node, and then choose either **Add Project Reference**, **Add Shared Project Reference**, or **Add COM Reference** from the context menu. (You can right-click the project node and select **Add** from the fly-out menu to choose from these options, too.)
56
+
57
+
:::image type="content" source="media/add-reference-options.png" alt-text="Screenshot of the Add Reference dialog from the context menu in Solution Explorer.":::
56
58
57
59
**Reference Manager** opens and lists the available references by group.
58
60
59
-
2. Specify the references to add, and then select **OK**.
61
+
:::image type="content" source="media/reference-manager.png" alt-text="Screenshot of the Reference Manager dialog box in Visual Studio.":::
62
+
63
+
2. Select a reference to add, and then select **OK**.
64
+
65
+
> [!NOTE]
66
+
> If you don't see the reference you're looking for, select **Browse** to locate the reference. (If you're developing C++ projects, you might not see a browse option.)
60
67
61
68
## Assemblies tab
62
69
@@ -68,7 +75,7 @@ All desktop projects contain an implicit reference to **mscorlib**. Visual Basic
68
75
69
76
If a project type doesn't support assemblies, the tab won't appear in the Reference Manager dialog box.
70
77
71
-
The **Assemblies** tab consists of two sub-tabs:
78
+
The **Assemblies** tab consists of two subtabs:
72
79
73
80
1.**Framework** lists all assemblies that constitute the targeted framework.
74
81
@@ -100,10 +107,10 @@ Some components in the list may not be shown, depending on the framework version
100
107
101
108
- A component that uses .NET Framework 4 is incompatible with a project that targets the .NET Framework 4.5.
102
109
103
-
You should avoid adding file references to outputs of another project in the same solution, because doing this may cause compilation errors. Instead, use the **Projects** tab of the **Add Reference** dialog box to create project-to-project references. This makes team development easier by enabling better management of the class libraries you create in your projects. For more information, see [Troubleshoot broken references](../ide/troubleshooting-broken-references.md).
110
+
You should avoid adding file references to outputs of another project in the same solution, because doing so might cause compilation errors. Instead, use the **Projects** tab of the **Add Reference** dialog box to create project-to-project references. This makes team development easier by enabling better management of the class libraries you create in your projects. For more information, see [Troubleshoot broken references](../ide/troubleshooting-broken-references.md).
104
111
105
112
> [!NOTE]
106
-
> In Visual Studio 2015 or later, a file reference instead of a project reference is created if the target framework version of one project is .NET Framework 4.5 or later, and the target version of the other project is .NET Framework 2, 3, 3.5, or 4.0.
113
+
> In Visual Studio 2015 or later, a file reference instead of a project reference is created if the target framework version of one project is .NET Framework 4.5 or later, and the target version of the other project is .NET Framework 2, 3, 3.5, or 4.0. For more information about .NET, .NET Framework, and .NET Core, see [What is .NET (and .NET Core)](/dotnet/core/introduction).
107
114
108
115
### To display an assembly in the Add Reference dialog box
109
116
@@ -135,20 +142,20 @@ You should avoid adding file references to outputs of another project in the sam
135
142
136
143
Creating the registry key under the `HKEY_LOCAL_MACHINE` node allows all users to see the assemblies in the specified location in the **Add Reference** dialog box. Creating the registry key under the `HKEY_CURRENT_USER` node affects only the setting for the current user.
137
144
138
-
Open the **Add Reference** dialog box again. The assemblies should appear on the **.NET** tab. If they do not, make sure that the assemblies are located in the specified *AssemblyLocation* directory, restart Visual Studio, and try again.
145
+
Open the **Add Reference** dialog box again. The assemblies should appear on the **.NET** tab. If they don't, make sure that the assemblies are located in the specified *AssemblyLocation* directory, restart Visual Studio, and try again.
139
146
140
147
## Projects tab
141
148
142
-
The **Projects** tab lists all compatible projects within the current solution, in the **Solution**sub-tab.
149
+
The **Projects** tab lists all compatible projects within the current solution, in the **Solution**subtab.
143
150
144
-
A project can reference another project that targets a different framework version. For example, you could create a project that targets the .NET Framework 4 but that references an assembly that's been built for the .NET Framework 2. However, the .NET Framework 2 project can't reference a .NET Framework 4 project. For more information, see [Framework targeting overview](../ide/visual-studio-multi-targeting-overview.md).
151
+
A project can reference another project that targets a different framework version. For example, you could create a project that targets the .NET Framework 4 but that references an assembly that's been built for the .NET Framework 2. However, the .NET Framework 2 project can't reference a .NET Framework 4 project. For more information, see [Framework targeting overview](visual-studio-multi-targeting-overview.md).
145
152
146
153
> [!NOTE]
147
154
> A project that targets the .NET Framework 4 is incompatible with a project that targets the .NET Framework 4 Client Profile.
148
155
149
156
## Shared Projects tab
150
157
151
-
Add a reference to a shared project on the **Shared Projects** tab of the Reference Manager dialog box. [Shared Projects](/xamarin/cross-platform/app-fundamentals/shared-projects?tabs=windows) let you write common code that's referenced by a number of different application projects.
158
+
Add a reference to a shared project on the **Shared Projects** tab of the Reference Manager dialog box. [Shared Projects](/xamarin/cross-platform/app-fundamentals/shared-projects?tabs=windows) let you write common code that's referenced by many different application projects.
152
159
153
160
## Universal Windows tab
154
161
@@ -165,7 +172,7 @@ Universal Windows app projects have a reference to the Universal Windows SDK by
165
172
166
173
An SDK is a collection of files that Visual Studio treats as a single component. In the **Extensions** tab, SDKs that apply to the project from which the Reference Manager dialog box was invoked are listed as single entries. When added to a project, all of the SDK content is consumed by Visual Studio such that the user doesn't need to take any further actions to leverage the SDK contents in IntelliSense, toolbox, designers, Object Browser, build, deployment, debugging, and packaging.
167
174
168
-
For information about how to display your SDK in the **Extensions** tab, see [Creating a Software Development Kit](../extensibility/creating-a-software-development-kit.md).
175
+
For information about how to display your SDK in the **Extensions** tab, see [Create a Software Development Kit](../extensibility/creating-a-software-development-kit.md).
169
176
170
177
> [!NOTE]
171
178
> If a project references an SDK that depends on another SDK, Visual Studio won't consume the second SDK unless you manually add a reference to the second SDK. When a user chooses an SDK on the **Extensions** tab, the Reference Manager dialog box helps you identify SDK dependencies by listing any dependencies in the details pane.
@@ -211,6 +218,16 @@ When doing a file reference to a WinMD, the expected layout is that the *\<FileN
211
218
212
219
The search bar in the Reference Manager dialog box operates over the tab that's in focus. For example, if a user types "System" in the search bar while the **Solution** tab is in focus, the search won't return any results unless the solution consists of a project name that contains "System".
213
220
221
+
## Remove a reference
222
+
223
+
You can remove unused references for [SDK style projects](/dotnet/core/project-sdk/overview) in Visual Studio by using the **Remove Unused Reference** menu item.
224
+
225
+
:::image type="content" source="media/remove-unused-reference.png" alt-text="Screenshot of the Remove Unused Reference dialog from the context menu in Solution Explorer.":::
226
+
227
+
For more information, see [Remove unused references](reference/remove-unused-references.md).
228
+
214
229
## See also
215
230
216
-
- [Manage references in a project](../ide/managing-references-in-a-project.md)
231
+
- [Manage references in a project](managing-references-in-a-project.md)
0 commit comments