0
votes

I've recently added some shared projects to my existing Visual Studio solution and now the build process on our TFS build server fails.

Project Type

Our build server was able to build the previous version of the solution and is again after the rollback. My shared projects are referenced like that in the .csproj files. (Created via Visual Studio)

  <Import Project="..\xxx\yyy.projitems" Label="Shared" />

The build works fine with Visual Studio and the command line, but on the TFS build server it fails with this error:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets (187): "DestinationFiles" refers to 1 item(s), and "SourceFiles" refers to 2 item(s). They must have the same number of items.

When executing the msbuild command via cmd, everything works fine. Also on the same maschine as the build server is running on. On the command line it looks like that:

"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /nologo "xxx.sln" /m:1 /p:Configuration="Debug" /p:Platform="Any CPU" 

Any ideas why this is not working?

2
Which version of TFS are you using?Cece Dong - MSFT
We have TFS 2015 Update 2Jochen
What's the build system you use? vNext or XAML? Can you share the detailed steps so that we can try to reproduce this issue.Eddie Chen - MSFT
And did you use "Copy" task in your project file? If yes, can you share the content?Eddie Chen - MSFT
XAML, It fails after getting the sources and running the RunMSBuild-Task. In de Xaml it is: <mtba:RunMSBuild CleanBuild="[CleanBuild]" .... No, we have no copy task. I have only added the shared project.Jochen

2 Answers

0
votes
  1. On your build agent machine, find the source folder that your build agent get resources, and use MSBuild command line to build the project in the source folder to check the result.

  2. Clean the Cache folder on client computer. The folder path is: C:\Users\username\AppData\Local\Microsoft\Team Foundation\x.0\Cache.

  3. Clean the Cache folder on Server machine. The folder path is: C:\TfsData\ApplicationTier\_fileCache (TFS 2015)

  4. Re-add all assemblies.

0
votes

Unfortunatelly I was not able to get the project running on our build and tfs server. But it works properly with Visual Studio Online and the new build system. Maybe upgrading to the latest TFS version would bring the same result.