Reputation: 570
I updated my service fabric VSTS continuous integration build process to the latest as mentioned in the link.
According to the updated document now we can use Hosted Agent as build agent. But build failing at second step with the following error
The target "Build" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Service Fabric Tools\Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.targets (112,11)" does not exist in the project, and will be ignored. SFProject\SFProject\SFProject.sfproj(0,0): Error MSB4057: The target "Build" does not exist in the project. Project "C:\a\1\s\SFProject\SFProject.sln" (1) is building "C:\a\1\s\SFProject\SFProject\SFProject.sfproj" (2) on node 1 (default targets). C:\a\1\s\SFProject\SFProject\SFProject.sfproj : error MSB4057: The target "Build" does not exist in the project.
I tried all answers found on stack overflow , but no solution working.
Upvotes: 0
Views: 353
Reputation: 3975
From the error message, it looks like the .sfproj project file is an older version. By opening the .sfproj in a text editor and checking the ProjectVersion property, you can determine the version. Starting with project version 1.1, which is the version produced by Service Fabric SDK 2.1, NuGet packages were introduced for building the project. The NuGet package is what provides support for building the project in the hosted build agent. So you'll need to make sure you've installed Service Fabric SDK 2.1 or higher and then upgrade your .sfproj by opening it within VS before attempting to build it in VSTS.
Upvotes: 1