Udostępnij za pośrednictwem


How to: Add and Remove References in Visual Studio (C#)

The Add Reference dialog box can be used either to add or to delete project references. This dialog box can be accessed from the Project menu. For more information, see Add Reference Dialog Box.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.

To add a project reference

  1. In Solution Explorer, select the project.

  2. On the Project menu, click Add Reference.

    The Add Reference dialog box opens.

  3. Select the tab indicating the type of component you want to reference.

  4. In the top pane, select the component you want to reference, and then click the Select button. Press CTRL while clicking to select multiple components.

    Note

    If the component you are looking for is not in the list, you may locate it using the Browse button.

  5. Click OK when you have selected all the components you need.

    Selected references will appear under the References node of the project.

To remove a project reference

  • In Solution Explorer, right-click the reference in the References node, and then click Remove.

See Also

Tasks

How to: Set the Reference Path (C#)

Concepts

Item Management in Projects

Reference

Add Reference Dialog Box