在NuGet软件包还原时Team Foundation Service构建失败

编程入门 行业动态 更新时间:2024-10-26 12:32:24
本文介绍了在NuGet软件包还原时Team Foundation Service构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的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:\a\src\Platform\Prod\Platform.Web\Platform.Web.csproj (436): The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see go.microsoft/fwlink/?LinkID=317568.

因此,然后我根据消息/URL重新排队构建,然后...再次发生.我已经在Google周围搜索了,但似乎无法弄清楚问题出在哪里.我可以在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?

谢谢.

推荐答案

链接中指定了解决方案错误消息本身中的a>.

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:

  • 签入.targets文件.
  • 在构建项目/解决方案之前,明确运行NuGet软件包还原.
  • 因此,我想为您解决问题,请遵循上述两个步骤.

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

    更多推荐

    在NuGet软件包还原时Team Foundation Service构建失败

    本文发布于:2023-11-14 09:02:00,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1586788.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:软件包   NuGet   Team   Service   Foundation

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!