为什么有些解决方案没有完全用TFS构建?

时间:2021-04-10 23:58:37

I'm noticing some solutions in Team Foundation Server 2008 won't build completely. As in, some number of the projects in the solution succeed but then one fails. The particular failing project says I’m missing an assembly reference. But I'm not - the project has the reference. It builds fine on my PC. I'm looking at the .csproj file that the build agent pulled down and it has the reference, too (it's line-for-line identical to the project I'm building).

我注意到Team Foundation Server 2008中的某些解决方案无法完全构建。如同,解决方案中的一些项目成功但后来失败了。特定的失败项目说我错过了一个装配参考。但我不是 - 该项目有参考。它在我的电脑上构建得很好。我正在查看构建代理程序下拉的.csproj文件,它也有引用(它与我正在构建的项目的行代码相同)。

The reference in question is to another project in the solution. At first I thought it wasn't building projects in the right order but the build log is telling me that it did (i.e., the project which the reference is in reference to built successfully). So my guess is that somehow on this project (and I’d say about 10-20% of the projects I’m having it build are failing) it’s looking at the wrong folder for assemblies, but I have no idea.

有问题的参考是解决方案中的另一个项目。起初我以为它不是以正确的顺序构建项目,但构建日志告诉我它确实(即,引用成功构建引用的项目)。所以我的猜测是,不知何故在这个项目上(我说大约有10-20%的项目我正在构建它们都失败了)它正在查看程序集的错误文件夹,但我不知道。

Has anyone ever seen this before?

有没有人见过这个?

I did have one Solution which was building things in the wrong order and some Googling seemed to indicate that this was an occasional side-effect of converting a VS2003 SLN file to a VS2008 SLN file (and it was happening in Visual Studio as well), so in that case I made a new SLN from scratch, checked that in "on top" of the problematic one, and it worked fine. But I tried that in the problem above and it didn’t make a difference.

我确实有一个解决方案正在以错误的顺序构建东西,一些谷歌搜索似乎表明这是偶尔的副作用将VS2003 SLN文件转换为VS2008 SLN文件(它也发生在Visual Studio中),所以在这种情况下,我从头开始制作了一个新的SLN,在问题的“顶部”检查了它,并且它工作正常。但我在上面的问题中尝试过这个并没有什么区别。

2 个解决方案

#1


I've seen it on multicore machines where the project dependencies haven't been setup correctly, meaning that tfs starts a project compiling before it's dependencies are finished compiling.

我已经在多核机器上看到过,项目依赖关系尚未正确设置,这意味着tfs在依赖项完成编译之前启动项目编译。

#2


At first I thought it wasn't building projects in the right order but the build log is telling me that it did (i.e., the project which the reference is in reference to built successfully).

起初我以为它不是以正确的顺序构建项目,但构建日志告诉我它确实(即,引用成功构建引用的项目)。

Define "built successfully." In particular, make sure the CoreCompile target was invoked and ran to completion. I've seen cases where a different target on the referenced project was built, but that target was insufficient to generate the output the dependent project needed. For example, a web project that includes a Silverlight control will call the GetXapOutputFile target on the Silverlight project -- which is fine & dandy, but it's no replacement for CoreCompile.

定义“已成功构建”。特别是,确保调用CoreCompile目标并运行完成。我已经看到了构建引用项目的不同目标的情况,但该目标不足以生成所需的依赖项目的输出。例如,包含Silverlight控件的Web项目将调用Silverlight项目上的GetXapOutputFile目标 - 这很好用,但它不能替代CoreCompile。

If this clue isn't enough to resolve your issue, you should probably post a link to the log and/or the msbuild makefiles.

如果这个线索不足以解决您的问题,您应该发布一个指向日志和/或msbuild makefile的链接。

#1


I've seen it on multicore machines where the project dependencies haven't been setup correctly, meaning that tfs starts a project compiling before it's dependencies are finished compiling.

我已经在多核机器上看到过,项目依赖关系尚未正确设置,这意味着tfs在依赖项完成编译之前启动项目编译。

#2


At first I thought it wasn't building projects in the right order but the build log is telling me that it did (i.e., the project which the reference is in reference to built successfully).

起初我以为它不是以正确的顺序构建项目,但构建日志告诉我它确实(即,引用成功构建引用的项目)。

Define "built successfully." In particular, make sure the CoreCompile target was invoked and ran to completion. I've seen cases where a different target on the referenced project was built, but that target was insufficient to generate the output the dependent project needed. For example, a web project that includes a Silverlight control will call the GetXapOutputFile target on the Silverlight project -- which is fine & dandy, but it's no replacement for CoreCompile.

定义“已成功构建”。特别是,确保调用CoreCompile目标并运行完成。我已经看到了构建引用项目的不同目标的情况,但该目标不足以生成所需的依赖项目的输出。例如,包含Silverlight控件的Web项目将调用Silverlight项目上的GetXapOutputFile目标 - 这很好用,但它不能替代CoreCompile。

If this clue isn't enough to resolve your issue, you should probably post a link to the log and/or the msbuild makefiles.

如果这个线索不足以解决您的问题,您应该发布一个指向日志和/或msbuild makefile的链接。