Share via


How to: Set the Reference Path (C#)

When you reference an assembly in your project, Visual Studio first searches for the assembly in the project directory. If you use an assembly not located in the project directory, you can specify its location in the Reference Paths Page, Project Designer (C#) of the Project Designer.

Note

The procedure for setting the reference path for Visual Basic projects is slightly different. For more information, see How to: Add or Remove References in Visual Studio (Visual Basic).

Note

If the reference to the assembly is not in the project or listed in the Reference Paths pane of the Project Designer, Visual Studio checks the directories that display files in the Add Reference Dialog Box.

You can add as many reference paths as you need.

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 set a reference path

  1. In Solution Explorer, select the project.

  2. On the Project menu, click <Project Name> Properties.

  3. Click Reference Paths.

  4. In the Folder text box, specify the path of the folder that contains assemblies. To browse to the folder, click the ellipsis (…).

  5. Click Add Folder.

To overwrite a reference path

  1. In Solution Explorer, select the project.

  2. On the Project menu, click <Project Name> Properties.

  3. Click Reference Paths.

  4. In the Reference Path box, select the path to overwrite.

  5. In the Folder text box, specify the path of the folder that contains assemblies. To browse to the path, click the ellipsis (…).

  6. Click Update. The path selected in the Reference Path box is overwritten with the path specified in the Folder text box.

To remove a reference path

  1. In Solution Explorer, select the project.

  2. On the Project menu, click <Project Name> Properties.

  3. Click Reference Paths.

  4. In the Reference Path box, select the path to remove.

  5. Click Remove.

See Also

Concepts

Introduction to the Project Designer

Reference

Reference Paths Page, Project Designer (C#)