Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HintPath on a added reference in Visual Studio

I know that I can add a HintPath to an external DLLs to help Visual Studio/TFS find the dll when it builds.

What I was wondering is... is it possible to add multiple HintPath?

For example... developers have their DLLs for one place and we do a GetLatest of those DLLs at a different place on the server hence the need for multiple HintPath.

What do you think, world?

like image 492
Maxime Rouiller Avatar asked Jan 20 '09 18:01

Maxime Rouiller


People also ask

How do I update references in Visual Studio 2019?

Open the project in Visual Studio. Right-click on the project's References folder and select Add Reference to open the Add Reference dialog box. Locate the new assembly version in the Add Reference dialog for each Infragistics assembly listed in your References folder.

What is reference path in Visual Studio project?

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.


2 Answers

Sorry, you can't use multiple HintPath's. Visual Studio/MSBuild takes only the last <HintPath> definition and will ignore any previous ones. Confirmed in VS2010 and VS2012.

like image 133
Alex Avatar answered Sep 22 '22 06:09

Alex


This answer is no longer valid. As Sardaukar's comment says, Visual Studio always blindly uses the last HintPath. Alex's answer supports this.


Alright. I'm faster than Stackoverflow this time. I tried to add it and it seems to work fine.

So multiple HintPath IS possible.

When you have this:

<Reference Include="System.ComponentModel.Composition.Codeplex">     <HintPath>..\..\..\MEF2_Preview2\bin\System.ComponentModel.Composition.Codeplex.dll</HintPath> </Reference> 

You can simply add more hint path like that:

<Reference Include="System.ComponentModel.Composition.Codeplex">     <HintPath>..\..\..\MEF2_Preview2\bin\System.ComponentModel.Composition.Codeplex.dll</HintPath>     <HintPath>D:\MEF\System.ComponentModel.Composition.Codeplex.dll</HintPath> </Reference> 
like image 33
Maxime Rouiller Avatar answered Sep 22 '22 06:09

Maxime Rouiller