Search code examples
visual-studio-2010tfssource-control-bindings

In TFS, can I bind a file in another folder to a Project?


I have a TFS project at $/src/main/MyProject/MyProject.csproj

It has a reference to a DLL at $/dependencies/dependency.dll.

The way I want things to work is that when my colleagues get MyProject, or open it in Visual Studio, I want TFS to go get the latest dependency.dll as well.

(In a similar way, I've actually bound MyProject to my solution in $/src/main/MySolution/MySolution.sln. So if a user gets MySolution and opens MySolution.sln then Visual Studio will go get MyProject as well. I just want to extend this to the next level, that of binding a file to a project.)


Solution

  • This is the perfect scenario to make use of NUGET and even though a little additional work, I would rather go this route :)

    Now if you dont want to create the Nupkg etc, one easy way out is to make use of the VisualStudio Add link option.

    "Add Link" is project specific and it will add a new entry to your project file specifying the location of your CS/Js/Dll etc file. As long as the file is available in the particular location TFS/VS will pull the latest copy of that file while opening the solution in VisualStudio. Make sure that the Add link creates a relative path to the file and not an absolute path.

    ADD vs ADD link