TFS Source Control Folder Structure
Posted on 2014-02-19
I have a question on maintaining Visual Studio project dependencies in source control.
This is how I have my projects and solutions set up in TFS.
$Team Project1 -> Main -> Sources -> MainApp (Contains MainApp.Sln) -> MainProject (Contains MainApp.csproj and other files)
$Team Project1 -> Main -> Sources -> CommonLib (Contains CommonLib.sln) -> CommonLibProj (Contains CommonLibProj.csproj and other files)
In other words, both MainApp and CommonLib are two independent folders under $Team Project1 -> Main -> Sources folder.
The MainApp.csproj is a c# windows forms application that has an assembly reference to CommonLib.csproj which is a class library project.
Local Folder Structure is similar:
Each solution compiles fine locally.
When I added a build definition to build MainApp solution, it failed. Based on the build error message, it seems that since TFS build has no knowledge of the other project, it could not find the CommonLib project and so it failed. So I modified the build definition to build both solutions (build the common library first). And the result is that build succeeded.
My questions are:
1. Did the build succeed because the source settings in the build definition include mappings of source control folders of both solutions to build agent folders?
2. Is this complaint with source control folder structure practices?
I’d like to keep this solution structure because it looks fairly simple unless I am violating any recommended good practices.
I am using TFS 2012 and Visual Studio 2012.
Thanks for your help.