TFS dll and references issues

James Wilson picture James Wilson · Aug 14, 2013 · Viewed 24.3k times · Source

We use Team Foundation Server for our main project. Every time we add a new employee either onsite or offsite we always have to set up the references manually.

Is it possible for TFS to copy/save/pass the dll's to the new user without having to install them every time?

For example I add new functionality and install DocumentFormat.OpenXml to my project. Set up the code it runs and works fine on my machine, I publish it works just fine live. I check in everything into TFS.

My co worker downloads the project attempts to build it and it errors out saying it doesn't know what to do with DocumentFormat.OpenXml because no reference exist.

So they they must download DocumentFormat.OpenXml and then they can build and run the project.

Is there a way for TFS to save us this step?

Answer

user1228 picture user1228 · Aug 14, 2013

Nothing to do with TFS, really. You just have to check in your dependencies to source control.

In your solution, add a folder called "Dependencies". Add a matching folder on disk in the same location in your solution hierarchy (annoying, I know). Add your dependent external DLLs to that directory.

enter image description here

As these are now part of the solution, they will travel with the solution into source control.

Reference these in your projects. It will look like this

enter image description here

but it should be recorded in your solution file as a relative path.

<Reference Include="Example">
  <HintPath>..\..\..\Dependencies\Example.DLL</HintPath>
</Reference>

If you're having problems with this not being the case, you can simply edit your project file and change the hint path.