Reputation: 1231
I have a VS solution that contains multiple projects and I'm trying to create a build definition to build only one of them.
My project structure in TFS is like this:
$myproject/Dev --- myproject.sln file is here
$myproject/Dev/Src/category/item/project1 --- project I want to build
$myproject/Dev/Src/web/item/project2 --- project2
$myproject/Dev/Src/service/item/project3 --- project3
project1 has a project reference set to project2
Then I set up my build definition like this:
1. In the Workspace tab
Status Source Control Folder Build Agent Folder
--------------------------------------------------------------------
Active $/myproject/Dev/Src/category/item/project1 $(SourceDir)\Dev\Src\category\item\project1
In the Process tab, Items to Build | Projects to Build, I select only project1 to build. When I build I get an error:
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1200): The referenced project '..\..\..\web\item\project2.csproj' does not exist.
If I set the Source Control Folder to $/myproject/Dev and Build Agent Folder to $(SourceDir)\Dev then everything is fine but I only want to kick off the build when something is checked into project1 folder, not everything under $/myproject/Dev.
Upvotes: 0
Views: 1124
Reputation: 6609
If project1 reference project2 (as you stated), how do you expect project1 to compile without project2 being previously compiled ?
If you only want to compile project1 then you need an assembly reference and not a project reference to project2.
But don't bother, in your build definition build project1 and its dependencies, it's simple and efficient.
Upvotes: 2