views:

520

answers:

5

I have a multi-project solution. I believe it is best practice to put all externally referenced assemblies (e.g. OSS stuff) in a folder that is on the relative path of the solution and it's component projects.

I'd like to create a real folder called Libs within the same Windows folder that contains my .sln file and add it to source control (Team System). I can't seem to figure out how to do this from the Solution Explorer. I can only do this from the Source Control Explorer. There does not appear to be a way to add this Libs Windows folder directly to the solution itself.

I see that you can create a "solution folder" -- but this does not correspond to a real windows folder and it apparently places the files within the top level solution folder.

I was wondering if there was a way to add the Libs folder to the solution so that it was apparent it was there and referenced by the component projects.

+3  A: 

Here's my structure in TFS

Development/
   Trunk/
      Binaries/  -- Shared libraries
      Source/
      Test/      
      Docs/      -- Documentation
      TeamBuildTypes/  -- Build definitions

You cannot do what you want directly in visual studio with the projects. The best thing you can do is create an external folder, plece the libraries in there, THEN add a solution folder and "Add Existing Item", and then select the libraries and click "Add As Link". It's actually hidden in the dropdown of the "Add" button. Click the little arrow and it will give you the option to "Add as Link".

Micah
Thanks Micah. The Add As Link option I think is new with VS2008. Alas, this is a VS2005 project and I don't see it.
Decker
A: 

I've typically seen third-part DLLs placed in a "ThirdParty" folder outside of any specific project in source control. Then in your project reference it from the "ThirdParty" folder and make sure Copy Local property of the reference is set to true.

Kon
A: 

For what is worth, we have a "PrecompiledLibraries" folder (what Micah called Binaries) outside the solution, and we reference there. If a new external lib changes, we simply place it in, relink, test and recompile. If everything is ok, commit and voila.

Martín Marconcini
A: 

Take a look at the Streamed Lines paper it suggests a number of structural patterns for dealing with third party dependencies

Richard
A: 

"Thanks Micah. The Add As Link option I think is new with VS2008. Alas, this is a VS2005 project and I don't see it. "

You can't use "Add as Link" within solution folders anyway.