0
votes

I am attempting to use CI on a Branch of one of my TFS projects. MSBuild only fails when I try to use a Branch. I point the same Build at the "trunk" project it works fine.

The error I receive from the build log:

Task "Label"

Label TeamFoundationServerUrl="http://TFSServer:8080/" BuildUri="vstfs:///Build/Build/6763" Name="Test_SF_20090619.1" Scope="$/MyProject" Recursive=True Comments="Label created by Team Build" Version="BuildServer3D143_66" Child="Replace" Files="$/" C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(812,5,812,5):

error : No matching items found in $/ in your workspace.

Done executing task "Label" -- FAILED.

Done building target "CoreLabel" in project "TFSBuild.proj" -- FAILED.

I believe this error is being caused by a lack of source files getting copied to the Build server.

Get task excerpt from build log:

Task "Get"

Get TeamFoundationServerUrl="http://TFSServer:8080/" BuildUri="vstfs:///Build/Build/6768" Force=True Overwrite=False PopulateOutput=False Preview=False Recursive=True Version="C204806" Workspace="BuildServer3D143_66"

Done executing task "Get".

This is a full build. There should be about a thousand files listed in the GET.

General Information

  • TFS 2008
  • Visual Studio 2008
  • Established build server (been running builds for the last year)
  • Project being branched is a ASP.NET web stie (2.0 Framework).

Full Build Params

  • /p:SkipClean=false
  • /p:SkipInitializeWorkspace=false
  • /p:ForceGet=true
  • /p:IncrementalBuild=false
  • /p:IncrementalGet=false

note: I know IncrementalBuild is redundent but I just wanted to be sure.

Questions:

  • Are there restrictions on builds off a branch?
  • Any idea why MSBuild fails to pull files from the branch workspace?
2

2 Answers

1
votes

If it's for CI then you're most likely doing an Incremental Get. TFS will only bother to get files it thinks have changed since its last get - e.g. if you delete any files from your server, it will still think you have those files so it won't get them again. In this case you'll need to run the build once with the incremental properties turned off so that it forces a full get of the source. You can do this by overriding the properties in the MSBuild command line box in the Queue Build dialog with:

/p:IncrementalGet=false;ForceGet=true

Another possibility that springs to mind is that the Label task is confused by your branch. It may be that your workspace is set up incorrectly, so check that you're mapping in everything it needs.

0
votes

I had two issues in this case.

First, the branch security did not give rights to the build service account. I had restricted the branch to our team's Tech Leads and Release Engineers. The build service account needed access as well. What tipped me of was while searching the internet I stumbled upon a posting by someone who had made the same mistake.

The second issue was a little more involved. While cleaning up my build project file, I removed the following section.

<SolutionToBuild Include="$(BuildProjectFolderPath)/../../_stage/MyProject/MySolution.sln">
        <Targets></Targets>
        <Properties></Properties>
</SolutionToBuild>

Which worked fine on projects I had already built at least once, but if this was a new build, that had not copied source files to the build server, then there would be no files and the build would fail.

Some of you may wonder if my other builds were working either, after all wouldn’t they have old build files. Yes, but I had targets defined that did all the work I actually cared about. So the SolutionToBuild is a little frivalous.