Team Foundation Service 构建在 NuGet 包还原时失败 [英] Team Foundation Service build fails on NuGet package restore

查看:28
本文介绍了Team Foundation Service 构建在 NuGet 包还原时失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在构建 Team Foundation Service 时遇到了一个奇怪的问题.我将它排队并开始正常,但随后失败并出现以下错误:

I'm having kind of an odd problem with my Team Foundation Service build. I queue it up and it starts just fine, but then it fails with the following error:

C:asrcPlatformProdPlatform.WebPlatform.Web.csproj (436): The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568.

然后我根据消息/URL 重新排队构建,然后......它再次发生.我已经用谷歌搜索了,但我似乎无法弄清楚问题所在.我可以在 Visual Studio 中很好地构建,并且该解决方案已配置为包还原.有什么想法吗?

So then I re-queue the build per the message/URL and...it happens again. I've Googled around but I can't seem to figure out what the issue is. I can build just fine in Visual Studio and the solution is configured for package restore. Any thoughts?

提前致谢.

推荐答案

解决方案在 link 在错误消息本身中.

The solution to this is specified in link in the error message itself.

这是由于该页面中指定的改进而发生的:

This is happening due to an Improvement as specified in that page:

改进

我们更新了 Microsoft.Bcl.Build 以使用不同的方法.新的版本将使用类似于 NuGet 的条件导入自动导入功能.这将始终允许项目在 Visual Studio 中加载.

We’ve updated Microsoft.Bcl.Build to use a different approach. The new version will use a conditional import similar to what NuGet’s automatic import feature does. This will always allow the project to load in Visual Studio.

不过,Microsoft.Bcl.Build 还会向您的项目添加一个目标,该目标将在构建完成后运行.这个目标检查是否当前构建恢复的包,如果是这样,构建失败可操作的错误消息:

However, Microsoft.Bcl.Build also adds a target to your project that will run after the build is finished. This target checks whether the current build restored packages and if so fail the build with an actionable error message:

第二次构建将修复此错误.请注意,这错误只会在包裹丢失时出现,所以它不像你总是要构建两次.

Building a second time will fix this error. Please note that this error will only appear if packages were missing so it’s not like you always have to build twice.

然后它针对构建服务器/持续集成(CI)的情况指定如下:

Then it specifies as below for the case of build server / continuous integration (CI):

此解决方案不涉及构建服务器/持续集成(CI) 情景.为了在构建服务器,你有两种选择:

This solution doesn’t address build server / continuous integration (CI) scenarios. In order to successfully use package restore on the build server, you have two options:

  1. 签入 .targets 文件.
  2. 在构建项目/解决方案之前显式运行 NuGet 包还原.

所以,我想为了解决您的问题,应该遵循上述两个步骤.

So, I suppose for your issue resolution the above two steps should be followed.

这篇关于Team Foundation Service 构建在 NuGet 包还原时失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆