xunit.core 与 NuGet 版本不兼容

xunit.core is incompatible with version of NuGet

我在解决方案中添加了一个新项目。我已经添加了一些 nuget 包,但是在 TFS 上构建时它失败了。在本地构建时它工作正常。我收到以下错误消息:

 C:\Builds\Server-Dev-CI\src\.nuget\NuGet.targets (58): The schema version of 'xunit.core' is incompatible with version 2.0.30828.5 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.
 C:\Builds\Server-Dev-CI\src\.nuget\NuGet.targets (58): The schema version of 'xunit.extensibility.execution' is incompatible with version 2.0.30828.5 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.
 C:\Builds\Server-Dev-CI\src\.nuget\NuGet.targets (58): One or more errors occurred.
 C:\Builds\Server-Dev-CI\src\.nuget\NuGet.targets (58): The command ""C:\Builds\Server-Dev-CI\src\.nuget\nuget.exe" install "C:\Builds\Server-Dev-CI\src\Modules\UnitTests.xUnit\packages.config" -source "https://nuget.org/api/v2/" -o "C:\Builds\Server-Dev-CI\src\packages"" exited with code 1.

当我在 VS2013 中(在构建服务器上)打开源代码时,我看到以下内容:

我必须单击“还原包”才能使其正常工作。

我已经更新了 NuGet。它从哪里获取“2.0.30828.5 of NuGet”???

我明白了。尽管 TFS 一直使用 Visual Studio 的 NuGet,但事实证明 TFS 运行:

C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\nuget.exe restore

我不得不打开控制台并更新 nuget:

nuget.exe update -self