TFS 2008 分支上的持续集成 MSBUILD 在标签上失败

发布于 2024-07-25 05:14:38 字数 1535 浏览 7 评论 0原文

我正在尝试在我的 TFS 项目之一的分支上使用 CI。 仅当我尝试使用分支时,MSBuild 才会失败。 我将相同的构建指向“主干”项目,它工作正常。

我从构建日志中收到的错误:

任务“标签”

标签 TeamFoundationServerUrl="http://TFSServer:8080/" BuildUri =“vstfs:///Build/Build/6763” 名称=“Test_SF_20090619.1” 范围=“$/MyProject”递归= True Comments="由 Team Build 创建的标签" 版本=“BuildServer3D143_66” 子=“替换”文件=“$/”C:\ Program 文件\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(812,5,812,5):

错误:在$/中找不到匹配的项目 在您的工作空间中。

完成执行任务“Label”——失败。

完成在项目中构建目标“CoreLabel” “TFSBuild.proj”——失败。

我相信此错误是由于缺少复制到构建服务器的源文件引起的。

从构建日志中获取任务摘录:

任务“获取”

获取 TeamFoundationServerUrl="http://TFSServer:8080/" BuildUri =“vstfs:///Build/Build/6768” 强制=True 覆盖=False PopulateOutput=False 预览=False 递归=真实版本=“C204806” 工作空间=“BuildServer3D143_66”

完成执行任务“Get”。

这是一个完整的构建。 GET 中应该列出大约一千个文件。

一般信息

  • TFS 2008
  • Visual Studio 2008
  • 建立的构建服务器(已 正在运行去年的构建)
  • 正在分支的项目是 ASP.NET web stie(2.0 框架)。

完整构建参数

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

注意:我知道 IncrementalBuild 是多余的,但我只是想确定一下。

问题

  • 在分支上进行构建是否有限制?
  • 知道为什么 MSBuild 无法从分支工作区中提取文件吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

白龙吟 2024-08-01 05:14:38

如果是用于 CI,那么您很可能会进行增量获取。 TFS 只会费心去获取它认为自上次获取以来已更改的文件 - 例如,如果您从服务器中删除任何文件,它仍然会认为您拥有这些文件,因此不会再次获取它们。 在这种情况下,您需要在关闭增量属性的情况下运行一次构建,以便强制完全获取源代码。 您可以通过以下方式覆盖“队列构建”对话框中 MSBuild 命令行框中的属性来实现此目的:

/p:IncrementalGet=false;ForceGet=true

另一种可能是您的分支混淆了“标签”任务。 您的工作区可能设置不正确,因此请检查您是否映射了它所需的所有内容。

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.

╰沐子 2024-08-01 05:14:38

在这个案例中我遇到了两个问题。

首先,分支安全没有为构建服务帐户授予权限。 我已将该分支限制为我们团队的技术主管和发布工程师。 构建服务帐户也需要访问权限。 让我想到的是,在搜索互联网时,我偶然发现了 由犯过同样错误的人发布

第二个问题有点复杂。 在清理构建项目文件时,我删除了以下部分。

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

这在我已经构建过至少一次的项目上工作得很好,但如果这是一个新的构建,没有将源文件复制到构建服务器,那么就不会有文件,构建也会失败。

你们中的一些人可能想知道我的其他构建是否也可以工作,毕竟它们不会有旧的构建文件。 是的,但我定义了目标来完成我真正关心的所有工作。 所以 SolutionToBuild 有点无聊。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文