How to build csproj files which exist in different workspace/folder in source control but are in the same solution

StackOverflow https://stackoverflow.com/questions/19945080

  •  30-07-2022
  •  | 
  •  

Question

I have build definition which builds this single solution in source control:

$/MyTeamProject/Dev

So, I use this mapping on the 'Workspace' tab for the build definition:

Source Control Folder: $/MyTeamProject/Dev
Build Agent Folder: $(SourceDir)\Dev

I added a few more projects to this same solution. These other projects exist in a different branch/folder root in source control:

$/MyTeamProject/MyProductName/Dev

So, I added this to the Workspace for the same build definition:

Source Control Folder: $/MyTeamProject/MyProductName/Dev/MyCsProjFolderRoot
Build Agent Folder: $(SourceDir)\MyProductName\Dev\MyCsProjFolderRoot

Build fails with:

C:\Dev\Sources\Dev\AllProjects.sln.metaproj: The project file "C:\Dev\Sources\Dev\..\MyteamProject\MyProduct\Dev\MyCsProjFolderRoot\MyProj.csproj" was not found.

On the build machine, I see the sources downloaded correctly in the structure I expect, but obviously the build doesn't agree.

I reviewed this question: Project file was not found however I am still unclear how to implement this. I am also confused that on the Workspace tab, there is a 'Browse For Folder' button for Build Agent Folder which says 'Please select a local folder.'

Am I going about this all wrong? Do I really need to select a local folder for the Build Agent Folder? (or does that just mean it must be not be a UNC folder - it must be mapped?)?

Was it helpful?

Solution

Solved. It was indeed that the Solution had relative reference to the projects and my workspace mapping wasn't reflecting this exactly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top