Search code examples
visual-studio-2010dependenciessolutionbuild-dependencies

Dll dependencies on a Visual Studio 2010 solution and TFS


How can I make a solution in visual studio so that the .dll dependencies that reside in some other directory totally different from where the solution itself is affected by "get latest".

What I've tried is creating a Dependencies solution folder within the solution itself and added the dlls to it, that way they belong to the solution even though they don't belong to the directory structure of the solution.

So for example the .sln file is in:

D:\tfs\repository\main\SolutionA\solution.sln

and the dlls are in:

d:\tfs\repository\main\SolutionX\Dependencies\Binaries

What I really want to achieve is to have a foolproof way to build the solution, including the following scenario:

1- Have a brand new installation of windows, visual studio, etc.
2- open visual studio
3- find solution.sln on TFS, double click on it so that visual studio gets every project and files in the solution, and opens the solution 4- successfully build

What happens when I try the Dependencies solution folder approach and repeat the scenario above, it will get all the projects within the solution, opens it, but the dependencies solution contents won't be pulled from TFS (although Visual Studio shows them on Solution explorer), which I think is flawed.

Some suggestions that don't involve creating pre/post build scripts are appreciated.


Solution

  • When you attempt to open a solution for the first time using the TFS Source Control Explorer, you may find that not all of your dependencies will be retrieved - the squiggly line may be highlighting some of your missing References.

    One work around is to...

    SOLUTION SETUP

    1. Checkout all of your source code from TFS (i.e. Main and all of the sub-directories)
    2. Open your solution in Visual Studio (i.e. MyApplication.sln)
    3. In the solution explorer, create a New Solution Folder called ThirdPartyDll, and then add the appropriate assembly references (i.e. Assembly1.dll, Assembly2.dll,...)
    4. Check-in your solution to TFS

    SAMPLE FILE STRUCTURE

    • Main
      • MyApplication.sln
      • Source
        • MyProjectA
          • MyProjectA.csproj
        • MyProjectB
          • MyProjectB.csproj
      • Dependencies
        • Assembly1.dll
        • Assembly2.dll