Reputation: 31
I'm using TFS 2015 on a local server and Visual Studio 2015. I have a solution that references projects from 2 different repositories.
On the local developer machines, I have the solution and project files references using relative paths:
TFS
----Repo1
--------Project1
--------Project2
--------Project3
--------Solution1
----Repo2
--------Project4
--------Project5
--------Project6
--------Solution2
Solution1 references Project4 by using ....\Repo2\Project4. This works fine when building the solution locally on VS 2015
Now I'm trying to automate the build in TFS 2015. Since the build definition for Solution1 is inside Repo1, it cannot reference anything in Repo2. So I mapped Repo2 as a folder in Repo1, and built all the projects individually. This worked, all the projects from Project1 to Project6 build individually, except for the last project, which is referencing Project4, Project5 and Project6. I get the following error message:
Error CS0246: The type or namespace name 'Project4' could not be found (are you missing a using directive or an assembly reference?)
I have tried adding parameters to MSBuild Arguments using /p:Reference, /p:ReferencePath, /p:AdditionalLibPaths in multiple ways: This is one attempt:
/p:ReferencePath="$(build.sourcesdirectory)\Repo2\Project4\bin\Debug $(build.sourcesdirectory)\Repo2\Project5\bin\Debug $(build.sourcesdirectory)\Repo2\Project6\bin\Debug"
But it doesn't seem to work.
How do I add references to the missing dlls so my last project can be built?
Thanks
Upvotes: 0
Views: 301
Reputation: 58980
It sounds like you're using TFVC (since you talk about 'mapping' folders), but this answer would be the same for Git:
Use project references instead of assembly references.
Upvotes: 0