Share code between projects in tfs 2010

Jimmy Engtröm picture Jimmy Engtröm · May 20, 2010 · Viewed 10.4k times · Source

What is the best way to handle code sharing in TFS 2010? We have a couple of Visual studio projects that other Visual Studio projects use. ex:

Shared Project

Project 1 Solution
-Shared Project
-Project 1 Project

Project 2 Solution
-Shared Project
-Project 2 Project

Also we have Third party code for example:
Third Party
-Telerik
--2009.1.402.35
--2009.02.0701.35

When I open my "Project 1" solution i want my shared code project to be included in that solution. (thats the way we work today).
We basically have one TFS Project that contains all the code. Now we want to use it the "right" (?) way, We would like to have Project 1 and 2 in separate TFS solutions.

If I for example makes sure we have all our project in the same structure on disk and just add the shared project to my Project 1 solution (even if the projects reside in two different TFS Projects) would that work with builds?

How have you solved the problem, I guess we are not the only ones having shared code between projects?

Cheers /Jimmy

Answer

Ladislau Szomoru picture Ladislau Szomoru · May 24, 2010

I am not sure if there is a "right way" to share code using Team Foundation Server 2010. I would recommend that you check the following blog post as customers are sharing their learnings: http://blogs.msdn.com/jmeier/archive/2007/03/17/code-sharing-in-team-foundation-server.aspx.

Thanks, Ladislau