Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tfs MSBuild生成在尝试使用“";获得;任务_Tfs_Msbuild_Build Automation - Fatal编程技术网

Tfs MSBuild生成在尝试使用“";获得;任务

Tfs MSBuild生成在尝试使用“";获得;任务,tfs,msbuild,build-automation,Tfs,Msbuild,Build Automation,我正在进行从TFS2010到TFS2012的测试升级。他们正在使用升级模板运行一组广泛的自定义MSBuild任务,以自动化其构建和部署。MSBuild项目最初是为TFS2005创建的,并在某个时候直接升级到TFS2010。他们正在构建的解决方案主要针对.NET2.0,并且在大多数开发中仍然使用VS2005 到目前为止,我已经安装了VS2005、VS2010和TFS2012以及更新1(按顺序),并将它们的TFS2010数据库升级到TFS2012。构建控制器与应用层和数据库位于同一台计算机上,这只是

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

到目前为止,我已经安装了VS2005、VS2010和TFS2012以及更新1(按顺序),并将它们的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(扩展管理器)

在 System.Activities.Hosting.WorkflowInstanceExtensionManager.CreateInstanceExtensions(活动 workflowDefinition、WorkflowInstanceExtensionManager(扩展管理器)

在 System.Activities.Hosting.WorkflowInstance.RegisterExtensionManager(WorkflowInstanceExtensionManager 扩展管理器)

在System.Activities.WorkflowApplication.EnsureInitialized()中

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

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

在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.ItaskeExecutionHost.Execute()

在 Microsoft.Build.BackEnd.TaskBuilder.d_u20.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>

将BE站点构建并部署到集成环境中
[修订]
网状物
c:\build
\\[修订]\BuildDrop
真的
症状=构建中断;复制步骤=使用团队构建启动构建
违约
假的
生成中的生成失败:
此工作项是由Team Build在生成失败时创建的。
生成日志文件位于:
错误/警告日志文件位于:
主要

您的生成在msbuild脚本中的“”上失败。您只能下拉一个文件,该文件是BeforeGet目标中的.exe文件。为了构建项目,您需要一个项目文件

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


当构建可以从构建定义工作区向下拉取文件时,为什么需要预构建验证步骤

我明白了。显然,
Get
任务需要
BuildUri
参数。我添加了
BuildUri=“$(BuildUri)”
一切正常。

是的,我知道它的失败之处。我已经确认传递给
Get
任务的参数是有效的。请记住,这在TFS2010环境中非常有效。至于“它为什么要做它所做的事情”,这是很久以前由其他人创造的。我不明白他们为什么做出这样的决定。TFS2012升级后,目的是将整个生成过程升级到更现代的版本。如果从本地框上的命令行运行msbuild,是否会出现错误?这将确保Get任务具有正确的参数。为什么在解决方案是无效参数时进行否决投票?我在回答中说这是可能的问题。我还引用了GetTask MSDN页面,该页面显示了所需的参数和示例。tfsbuild.proj中的
ProjectFileVersion
值是多少?
ProjectFileVersion
为4。MSBuild平台设置为
x86
。您的工作区是否包含文件规范?