Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot Edit or Add Path to Reference File in Visual Studio 2010

Cannot Edit or Add Path to Reference File , I cannot edit or add a path to a referece file. I have inherited a project at work. When I open the project and go to the references scetion in the Visual Studio 2010 IDE there are some little yellow warning signs showing that there is something amiss with the reference listed there. But when I click on the item and look at the missing path, I find that the name "Path" is in grey suggesting that I cannot edit it and, sure enough, I cannot add the path name to the adjoining field. What causes this? I have the solution file and the project file checked out in edit mode.

When I open the project file, the error list also gives the warnings for each missing reference: "The reference component '(the file name)' cound not be found"

Well, I know where they are but editing the path to point there is the problem.

like image 500
xarzu Avatar asked May 17 '12 16:05

xarzu


People also ask

How do I add a file reference in Visual Studio?

Restart Visual Studio, create a new C# UWP app project, and then right-click on the project and choose Add Reference.

How do I enable references in Visual Studio?

Press Shift + F12 to find all references.

How do I change the reference path in Visual Studio?

If you're using Visual Basic, select the References page, and then click the Reference Paths button. In the Reference Paths dialog box, type the path of the folder that contains the item you want to reference in the Folder field, and then click the Add Folder button. If you're using C#, select the Reference Paths page.

What is reference path in Visual Studio project?

If you now view the properties for Project B, notice that the Reference Path property setting contains an entry that is the full path to the Project A Bin directory. The Reference Path property tells Visual Studio where to look for referenced assemblies; the default is the path you used when you added the reference.


2 Answers

I think in this situation you've got 2 choices:

  1. Remove the broken references and re-add them to the project - this is easy to do if you don't have too many broken references.

  2. Right click on the project file in Solution Explorer and select 'Edit Project File' and manually fix the reference hint paths (the project file is XML). Save, and right-click the project file in Solution Explorer again and select 'Reload Project'.

like image 171
KazR Avatar answered Sep 24 '22 08:09

KazR


Editing the project file by hand found the problem. THe project file is an xml file. It did not take long to find a reference in the path that was wrong.

like image 21
xarzu Avatar answered Sep 20 '22 08:09

xarzu