[英]TFS On-Prem Build Agent Using Old Version Of NuGet.exe
We are hosting TFS 2017 Update 2 on-prem, and using on-prem build agents.我们在本地托管 TFS 2017 Update 2,并使用本地构建代理。 The latest version of NuGet.exe is currently 4.3.0, but our build agents always default to using v4.0.0.
NuGet.exe 的最新版本目前是 4.3.0,但我们的构建代理始终默认使用 v4.0.0。 How can I get our build agents to use the latest version of NuGet.exe?
如何让我们的构建代理使用最新版本的 NuGet.exe?
We need to update because NuGet restore
is failing when using v4.0.0, but works with v4.3.0, since we are dealing with new .Net Standard 2.0 packages.我们需要更新,因为
NuGet restore
在使用 v4.0.0 时失败,但适用于 v4.3.0,因为我们正在处理新的 .Net Standard 2.0 包。 On our build server I was able to do NuGet.exe update -self
to update the NuGet.exe found at C:\\Builds\\_work\\_tool\\NuGet\\4.0.0\\x64\\nuget.exe
from 4.0.0 to 4.3.0, but that C:\\Builds\\_work\\_tool
directory regularly gets deleted and recreated, so this isn't a persistent workaround.在我们的构建服务器上,我能够执行
NuGet.exe update -self
以将位于C:\\Builds\\_work\\_tool\\NuGet\\4.0.0\\x64\\nuget.exe
从 4.0.0 更新到 4.3。 0,但是C:\\Builds\\_work\\_tool
目录会定期被删除和重新创建,所以这不是一个持久的解决方法。
How can I get our build agents to always use the latest version of NuGet.exe, or at least v4.3.0?如何让我们的构建代理始终使用最新版本的 NuGet.exe,或者至少是 v4.3.0?
我知道你不应该用链接回答,但这篇文章提供了你需要的所有细节,确认任务确实仍然使用 4.0.0,如何使用 VSTS 和 TFS 2018 你不必担心关于这个(有一个新的 NuGet 安装程序任务)以及如何通过 PowerShell 脚本为 VS 2017.2(及更早版本)重新创建这种任务, 在你的构建中使用最新的 NuGet
Based on Greg's linked answer, but a little bit simpler:基于 Greg 的链接答案,但更简单一点:
That is it.就是这样。 Replacing the "NuGet Installer" that requires you to specify a version with the "NuGet Restore" that just uses the NuGet.exe from the path as set in "NuGet Tool Installer" is easier.
将需要您指定版本的“NuGet 安装程序”替换为仅使用“NuGet 工具安装程序”中设置的路径中的 NuGet.exe 的“NuGet 还原”更容易。 Also mind the confusing naming (NuGet Tool Installer/NuGet Installer - the two are rather different).
还要注意令人困惑的命名(NuGet 工具安装程序/NuGet 安装程序 - 两者相当不同)。
Having to tinker so much with the not so old TFS 2017 infrastructure is a shame.不得不对不太老的 TFS 2017 基础设施进行如此多的修补是一种耻辱。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.