When adding a reference to an assembly located within the solution directory, is there any way to add it relatively, so that when checked in and out of a repository it is referenced in projects correctly?
To expand upon Pavel Minaev's original comment - The GUI for Visual Studio supports relative references with the assumption that your .sln is the root of the relative reference. So if you have a solution C:\myProj\myProj.sln
, any references you add in subfolders of C:\myProj\
are automatically added as relative references.
To add a relative reference in a separate directory, such as C:/myReferences/myDLL.dll
, do the following:
Edit the < HintPath > to be equal to
<HintPath>..\..\myReferences\myDLL.dll</HintPath>
This now references C:\myReferences\myDLL.dll
.
Hope this helps.