'System.Net.Http 4.0.0' 软件包需要 NuGet 客户端版本“3.0”或更高版本

'System.Net.Http 4.0.0' package requires NuGet client version '3.0' or above

使用团队城市作为我们的 CI,我开始收到此错误消息。我们最近显然更新了 System.Net.Http,现在需要新版本的 NuGet。如何让团队城市找到新的 NuGet 版本。我已经尝试安装 VS2015 并通过那里更新 NuGet 包管理器。我试过直接指向命令行nuget.exe(不知道是否已经更新到v3?)

[restore] The 'System.Net.Http 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.60717.93'.
[restore] Process exited with code 1

我是否只需要等到 MS 将新的 nuget 包推送到 nuget?

谢谢

我认为您需要 TeamCity 9.1,因为该版本包含 VS2015 构建工具:https://confluence.jetbrains.com/display/TCD9/What%27s+New+in+TeamCity+9.1

NuGet 3.0 与 VS2015 一起发布:http://docs.nuget.org/release-notes/nuget-3.0.0

在 Visual Studio 的早期版本中,您可以添加对 System.Net.Http 的系统引用,但 Microsoft 现在已将其移至 NuGet 包中。

从这里下载 NuGet 3.1 url:

http://dist.nuget.org/win-x86-commandline/v3.1.0-beta/nuget.exe

然后将其放在您的构建服务器上,将目录放在您的路径中,然后 运行 您的 NuGet 构建步骤作为 TeamCity 中的 "Command Line" 命令,使用 NuGet.exe.

在您的 teamcity 客户端上,您可以配置可供构建代理使用的 nuget 版本。

转到管理 -> 集成 -> NuGet

在此屏幕中,您可以单击获取 NuGet 并检索最新版本。然后您应该能够在构建步骤中指定该版本。