8

I have a project where I use the reference paths to store the necessary dlls.
My problem is when I checked these in my TFS server and after my colleague got the latest version from the TFS server, he could not see the reference paths on the property page in the project files.

What did I do wrong?

Enrico Campidoglio
  • 56,676
  • 12
  • 126
  • 154
user295541
  • 1,015
  • 4
  • 16
  • 26
  • If your references are set to `Specific Version=True`, try change that to `False` and then they should see the references load correctly on next solution load. Developers often have slightly different versions of 3rd party frameworks installed. – Seph Mar 13 '12 at 13:01

3 Answers3

8

Assembly reference paths are not part of the project file. Visual Studio saves them in a user specific setting file (*.csproj.user or *.vbproj.user), which shouldn't be added to source control.

If you want to share assembly reference paths with the rest of the team you can add them manually to a project file with the <AssemblySearchPaths> element:

<PropertyGroup>
    <AssemblySearchPaths>
        ..\..\MyReferences\;
    </AssemblySearchPaths>
</PropertyGroup>
Community
  • 1
  • 1
Enrico Campidoglio
  • 56,676
  • 12
  • 126
  • 154
0

I found a better and for me working solutin, adding a <Target> with name BeforeResolveReferences, that sets the "AssemblySearchPaths" Property, adding my CommonLibs folder as first path to look for assemblies:

<Target Name="BeforeResolveReferences">
    <CreateProperty Value="..\CommonLibs\;$(AssemblySearchPaths)">
        <Output TaskParameter="Value" PropertyName="AssemblySearchPaths" />
    </CreateProperty>
</Target>

The to be included Assemblies are all in folder with the name "CommonLibs" on the same level as the solution folder(s).

Adding <AssemblySearchPaths> as mentioned in the previous answer did sadly not work for me:

Although the DLLs referenced in the new path could be found by the compiler, the normal System.* Assemblies can not be found any more.

In Visual Studio 2010 the <AssemblySearchPaths> in project files might not be a valid option any more, as the editor warns, that this element is not valid.

minni
  • 1,144
  • 11
  • 9
0

The reference paths are held in the *.csproj.user file which is a per user file containing project settings. In order for your colleague to build the project after getting the latest from source control they would need to manually add the reference path to the project themselves.

Leom Burke
  • 8,143
  • 1
  • 35
  • 30