Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2012 build error The "CreateWorkspaceTask" task was not given a value for the required parameter "BuildAgentUri"

Tags:

tfs

We upgraded to TFS 2012 and changed our legacy build templates to remove all strong name references to Microsoft.TeamFoundation namespaces from the Activity element. We are now getting the following error when building:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets (801): The "CreateWorkspaceTask" task was not given a value for the required parameter "BuildAgentUri".

Has anyone else encountered this error?

like image 817
user1698744 Avatar asked Sep 25 '12 23:09

user1698744


2 Answers

I just resolved this issue earlier today....

Navigate and open:-

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets

Find the section resembling the following:-

CreateWorkspaceTask TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" BuildDirectory="$(BuildDirectory)" SourcesDirectory="$(SolutionRoot)" Name="$(WorkspaceName)" Comment="$(CreateWorkspaceTaskComment)"

Replace it with:-

<!-- Create the workspace for this build -->
    <CreateWorkspaceTask
          TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
          BuildUri="$(BuildUri)"
          BuildDirectory="$(BuildDirectory)"
          SourcesDirectory="$(SolutionRoot)"
          Name="$(WorkspaceName)"
          Comment="$(CreateWorkspaceTaskComment)"
          Condition=" '$(ProjectFileVersion)' != '4'">
      <Output TaskParameter="Name" PropertyName="WorkspaceName" />
      <Output TaskParameter="Owner" PropertyName="WorkspaceOwner" />
    </CreateWorkspaceTask>
    <CreateWorkspaceTask
          TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
          BuildUri="$(BuildUri)"
          BuildDirectory="$(BuildDirectory)"
          BuildAgentUri="$(BuildAgentUri)"
          SourcesDirectory="$(SolutionRoot)"
          Name="$(WorkspaceName)"
          Comment="$(CreateWorkspaceTaskComment)"
          Condition=" '$(ProjectFileVersion)' == '4'">
      <Output TaskParameter="Name" PropertyName="WorkspaceName" />
      <Output TaskParameter="Owner" PropertyName="WorkspaceOwner" />
    </CreateWorkspaceTask>

Please pay special attention to the casing of the text as this is an XML document...

Please let me know if this helps...

Cheers!

... Chev

like image 110
Chev Avatar answered Nov 06 '22 03:11

Chev


We ran into this same issue on one of our build machines. The build machine was working fine one day and stopped the next. The only change was finishing the installation of Service Pack 1 for Visual Studio 2010.

We figured that possibly MSBuild got rolled to a previous version.

So we looked at this file on another build machine and that section looked exactly like the snippet Chev provided.

So we went into "progams and features" on the build machine and did a Repair on the TFS 2012 installation. That updated the Microsoft.TeamFoundation.Build.targets file to look just like the snippet provided by Chev.

Now the builds run correctly again.

like image 6
BubbleSort Avatar answered Nov 06 '22 05:11

BubbleSort