When working with a team, it is always a good idea to have dependencies in a separate folder so everyone can reference them using relative paths:
References from this dependencies folder then look as follows in the MyWinApp.csproj file:
<ItemGroup> <Reference Include="Boo.Lang, Version=126.96.36.199, ..."> <SpecificVersion>False</SpecificVersion> <HintPath>..\Dependencies\\Boo.Lang.dll</HintPath> </Reference>... <Reference Include="System" />... <Reference Include="System.Xml" /> </ItemGroup>
So every team member that checks out the project will be able to work in their workspace, as well as the build server will have all the proper references. Great.
But what about the following scenario: depending on Release or Debug, you need different references - how can you solve this problem? The first step is to go and create a directory for each configuration below the Dependencies folder:
Next, copy the assemblies to the respective directories. Plus, you have to modify the .csproj file and add $(Configuration) to the external reference's hint path:
<ItemGroup> <Reference Include="Boo.Lang, Version=188.8.131.52, ..."> <SpecificVersion>False</SpecificVersion> <HintPath>..\Dependencies\$(Configuration)\\Boo.Lang.dll</HintPath> </Reference>
That's it - even Visual Studio will honor this change and still provide you with IntelliSense.
Before closing, I want to mention a new tool - even though it doesn't (yet) support editing the hint path, you should check out Attrice's Microsoft Build Sidekick. It allows you to graphically edit .*proj files: