2

Hope anyone here can help. I've been on it for days.

I have VSO and am using service fabric. My builds always worked on VSO until a new developer installed the latest Service Fabric SDK on his machine. Being ok with using the latest SDKs I updated mine also. This didn't affect anything locally. But it's SF project is not building on VSO anymore.

This is the error:

ServiceFabricBackup\SocialHootz.Refs\SocialHootz.Refs.sfproj(0,0): Error MSB4057: The target "Package" does not exist in the project. Process 'msbuild.exe' exited with code '1'.

My gut feel is that the Hosted 2017 service on VSO doesn't use the latest version of MSBUILD but I'm at a loss at this stage.

duongthaiha
  • 855
  • 6
  • 17
  • can you check if the version of the msbuild package referenced inside your sfproj file e.g. `Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.2\build\Microsoft.VisualStudio.Azure.Fabric.Application.props"` is equal to the version referenced as nuget package `Microsoft.VisualStudio.Azure.Fabric.MSBuild`? – LoekD Nov 03 '17 at 08:33
  • @LoekD I can see in the SFProj 'code' – user3688632 Nov 03 '17 at 16:57
  • Close your solution and the edit ypur packages.config file and sfproj file to have parity for the version of MS.VS.Azure.Fabric.MSBuild (latest is 1.6.3) then reload your project and build it – Mardoxx Nov 05 '17 at 18:35
  • 1
    I fixed it. All I needed to do was was unlink the wildcard *.* from the build textbox and navigate specifically to the sfproj file. – user3688632 Nov 14 '17 at 12:05

1 Answers1

1

I recently ran across this issue. I have a Service Fabric build that failed with "Error MSB4057: The target "Package" does not exist in the project." I was in the process of moving the VSTS builds to 2017 Hosts. The problem turned out to be a ServiceFabricBackup folder that was created by some other operation. The creation of this folder and the wildcard on the build (**\*.sfproj) caused the build to try to build two service fabric projects. Removal of the ServiceFabricBackup folder fixed the issue. Equivalently, I could have specified the sfproj file in the build, as user3688632 did.

Note that there are other possible issues that generate this error: https://github.com/Azure/service-fabric-issues/issues/64

sscheider
  • 522
  • 5
  • 14
  • user3688632's question shows this problem, calling out ServiceFabricBackup folder: ServiceFabricBackup\SocialHootz.Refs\SocialHootz.Refs.sfproj(0,0): Error MSB4057: The target "Package" does not exist in the project. Process 'msbuild.exe' exited with code '1'. – sscheider Jan 26 '18 at 16:41
  • I found at least one of the causes of this. After upgrading VS 2017 from 15.5.5 to 15.5.6, a message box popped up when I opened a service fabic project. The message is: "Your fabric application project '[path to .sfproj file]' must be upgraded in order to be loaded. Would you like to do that?" Clicking the "Yes" button created the ServiceFabricBackup folder. – sscheider Jan 31 '18 at 14:24