1
votes

I am using TFS 2017 to build a solution that has three projects linked to it. Two of the projects are located elsewhere in TFS. When I build the main project which depends on the other two projects I get errors because the other two projects are not being build. How can I force TFS to build all dependent projects?

1
"Two of the projects are located elsewhere in TFS". Are they still in the same project ? If so, does Your build even pull theese Projects too ? do you use GIT or TFVC?D.J.
Hi @D.J. Yes, the two other project are in the same project. We are using TFVC. I have a build definition that builds the main project. Do I need to make a build definition for the two other projects as well? Will they be triggered when the main project is built?doorman
You can do it with one BuildDefinition. Are you really building the main-project ? If all 3 projects are linked in the Solution you should build the Solution.D.J.
Nope. Inside your BuildDefinition go to "Get sources". There you have the "Workspace mappings". You can Add FolderB thereD.J.
If a new folder is required you have to add this, yes. But i would recommend you to rethink the structure of your projects.D.J.

1 Answers

1
votes

With Visual Studio Build task you could either build the whole solution by select .sln or only build MSBuild project (.*proj) files.

If you select the .proj file in the build task, for building three different projects, you also need to add three tasks.

In your case, since you have selected .sln file, TFS will auto build the whole solution including all projects under it. But in the workspace mappings, you need to make sure that you Map all folders that contain files that your build process requires. For example, if you add another project, you might have to add another mapping to the workspace.

So it would not be automatically done by scanning the dependencies of the solution. You have to also add Folder B mappings in the get sources of the definition.

  • Besides if this is a CI build, in most cases you should make sure that these mappings match the filter settings of your CI trigger on the Triggers tab.
  • For more information on how to optimize a TFVC workspace, see Optimize your workspace.