-1

我正在进行从 TFS2010 到 TFS2012 的测试升级。他们正在使用升级模板来运行大量自定义 MSBuild 任务,以自动化他们的构建和部署。MSBuild 项目最初是为 TFS2005 创建的,并在某些时候直接升级到 TFS2010。他们正在构建的解决方案主要针对 .NET 2.0,并且他们仍在使用 VS2005 进行大多数开发。

到目前为止,我已经安装了带有 Update 1 的 VS2005、VS2010 和 TFS2012(按此顺序),并将它们的 TFS2010 数据库升级到 TFS2012。构建控制器与应用层和数据库位于同一台机器上,只是因为这是一个“概念证明”升级,以识别在真正升级之前需要在构建过程中解决的任何问题。

当我运行他们的任何基于 MSBuild 的构建时,我收到以下错误:

C:\Builds\18\Web\ES-INTEGRATION-WebTest\BuildType\TFSBuild.proj (75):必须配置“Microsoft.TeamFoundation.Build.Client.IBuildDetail”类型的扩展才能运行此工作流。C:\Builds\18\Web\ES-INTEGRATION-WebTest\BuildType\TFSBuild.proj (75):“获取”任务意外失败。

System.Activities.ValidationException:必须配置“Microsoft.TeamFoundation.Build.Client.IBuildDetail”类型的扩展才能运行此工作流。

在 System.Activities.Hosting.WorkflowInstanceExtensionCollection..ctor(活动 workflowDefinition,WorkflowInstanceExtensionManager extensionManager)

在 System.Activities.Hosting.WorkflowInstanceExtensionManager.CreateInstanceExtensions(活动工作流定义,WorkflowInstanceExtensionManager extensionManager)

在 System.Activities.Hosting.WorkflowInstance.RegisterExtensionManager(WorkflowInstanceExtensionManager extensionManager)

在 System.Activities.WorkflowApplication.EnsureInitialized()

在 System.Activities.WorkflowApplication.RunInstance(WorkflowApplication 实例)

在 System.Activities.WorkflowApplication.Invoke(活动活动,IDictionary`2 输入,WorkflowInstanceExtensionManager 扩展,TimeSpan 超时)

在 System.Activities.WorkflowInvoker.Invoke(活动工作流,IDictionary`2 输入,TimeSpan 超时,WorkflowInstanceExtensionManager 扩展)

在 Microsoft.TeamFoundation.Build.Tasks.WorkflowTask.ExecuteInternal()

在 Microsoft.TeamFoundation.Build.Tasks.Task.Execute()

在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()

在 Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext()

我已经完成并将构建缩减为一个重现问题的非常小的案例。完整的.proj文件如下:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="DesktopBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

    <!-- Do not edit this -->
    <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets" />
    <ProjectExtensions>
        <!--  DESCRIPTION
     The description is associated with a build type. Edit the value for making changes.
    -->
        <Description>Builds and Deploys the BE site to the integration environment</Description>
        <!--  BUILD MACHINE
     Name of the machine which will be used to build the solutions selected.
    -->
        <BuildMachine>[redacted]</BuildMachine>
    </ProjectExtensions>
    <PropertyGroup>
        <!--  TEAM PROJECT
     The team project which will be built using this build type.
    -->
        <TeamProject>Web</TeamProject>
        <!--  BUILD DIRECTORY
     The directory on the build machine that will be used to build the
     selected solutions. The directory must be a local path on the build
     machine (e.g. c:\build).
    -->
        <BuildDirectoryPath>c:\build</BuildDirectoryPath>
        <!--  DROP LOCATION
      The location to drop (copy) the built binaries and the log files after
     the build is complete. This location has to be a valid UNC path of the
     form \\Server\Share. The build machine service account and application
     tier account need to have read write permission on this share.
    -->
        <DropLocation>\\[redacted]\BuildDrop</DropLocation>
        <!--  TESTING
     Set this flag to enable/disable running tests as a post build step.
    -->
        <RunTest>True</RunTest>
        <!--  WorkItemFieldValues
      Add/edit key value pairs to set values for fields in the work item created
      during the build process. Please make sure the field names are valid 
      for the work item type being used.
    -->
        <WorkItemFieldValues>Symptom=build break;Steps To Reproduce=Start the build using Team Build</WorkItemFieldValues>
        <!--  CODE ANALYSIS
       To change CodeAnalysis behavior edit this value. Valid values for this
       can be Default,Always or Never.

     Default - To perform code analysis as per the individual project settings
     Always  - To always perform code analysis irrespective of project settings
     Never   - To never perform code analysis irrespective of project settings
     -->
        <RunCodeAnalysis>Default</RunCodeAnalysis>
        <!--  UPDATE ASSOCIATED WORK ITEMS
     Set this flag to enable/disable updating associated workitems on a successful build
    -->
        <UpdateAssociatedWorkItems>false</UpdateAssociatedWorkItems>
        <!-- Title for the work item created on build failure -->
        <WorkItemTitle>Build failure in build:</WorkItemTitle>
        <!-- Description for the work item created on build failure -->
        <DescriptionText>This work item was created by Team Build on a build failure.</DescriptionText>
        <!-- Text pointing to log file location on build failure -->
        <BuildlogText>The build log file is at:</BuildlogText>
        <!-- Text pointing to error/warnings file location on build failure -->
        <ErrorWarningLogText>The errors/warnings log file is at:</ErrorWarningLogText>
    </PropertyGroup>



    <PropertyGroup>
        <SourceBranchPath>Main</SourceBranchPath>
    </PropertyGroup>

  <!-- Does some basic validation of the environment before the build starts -->
  <Target Name="PreBuildValidations" >
    <Get FileSpec="$/Web/$(SourceBranchPath)/BuildFiles/Tools/PSExec.exe" Workspace="$(WorkspaceName)" Recursive="false" Force="true" TeamFoundationServerUrl="$(TeamFoundationServerUrl)"/>
  </Target>

    <Target Name="BeforeGet">
        <CallTarget Targets="PreBuildValidations" />
    </Target>


</Project>
4

2 回答 2

1

我想到了。显然,该BuildUri参数是Get任务所必需的。我补充说BuildUri="$(BuildURI)",一切都很好。

于 2013-04-02T19:34:41.803 回答
-1

您的构建在 msbuild 脚本中的“获取任务”上失败。您只在 BeforeGet 目标中拉下一个 .exe 文件。为了构建项目,您需要一个项目文件。

看起来错误可能是因为您在 Get 任务中缺少参数或传入了无效参数。

当构建可以从构建定义工作区中拉出文件时,为什么需要 prebuildvalidation 步骤?

于 2013-04-02T17:01:05.233 回答