views:

262

answers:

1

I am using Team Foundation as source control for a solution with eight C# projects. In order to enforce decoupling and stability, I have only enabled dependencies between the project and their tests.

What I would like to do is create a common folder where the compiled libraries and external tools can be placed and shared across the solution to all of the projects. The problem is that Solution Folders seem to be virtual, and even if they weren't there are still a few other problems such as relative pathing and keeping the DLLs updated in TFS source control.

So my question is, is it possible to create a common folder containing libraries that all of the projects in the solution can reference with a relative path and still capable of being controlled by TFS?

Thanks in advance!

+1  A: 

I don't know about TFS, but whenever I add third party libraries for a VS solution to source control I usually do it in the solution folder.

+-- MySolution
    | // The solution is in source control
    |
    +-- MyProject1
    |   |
    |   +-- Project and source code files for a specific project
    |
    +-- MyProject1.Test
    |   |
    |   +-- Test files for MyProject1
    |
    +-- Third Party
    |   |
    |   +-- Library dll's are stored here.
    |
    |
    +-- Solution files, more project folders, user settings (user settings are not in source control) etc…

When you point out the third party libraries, they should be linked by a relative path. The only way to verify this is to open up the *proj file and look under dependencies tags if the library in question is linked with a relative path instead of an absolute one.

To add the libraries into source control you just add the Third Party folder. Since I'm not using TFS I'm not sure if it will botch this set-up (I use Subversion or Mercurial as source control and they work nicely).

Spoike
As an addendum: I've seen many open source visual studio solutions that source control the library dependencies this way as well.
Spoike
Thanks but I don't think TFS will recognize this as the folder can't be added to the solution. I wonder if I could use this approach but manually upload the libraries through the TFS somehow.
Chance
Ah yea - that worked, thanks!
Chance