Search code examples
tfsmsbuildxunitbuild-server

xunit.core is incompatible with version of NuGet


I added a new project to the solution. I've added some nuget packages however it fails when building on TFS. It works fine when building locally. I get the following error messages:

 C:\Builds\8\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\8\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\8\Server-Dev-CI\src\.nuget\NuGet.targets (58): One or more errors occurred.
 C:\Builds\8\Server-Dev-CI\src\.nuget\NuGet.targets (58): The command ""C:\Builds\8\Server-Dev-CI\src\.nuget\nuget.exe" install "C:\Builds\8\Server-Dev-CI\src\Modules\UnitTests.xUnit\packages.config" -source "https://nuget.org/api/v2/" -o "C:\Builds\8\Server-Dev-CI\src\packages"" exited with code 1.

When I open the sources in VS2013 (on the build server) I see the following: enter image description here

I have to click Restore Packages to get it to work. enter image description here

I already updated NuGet. Where is it getting " 2.0.30828.5 of NuGet" from???

enter image description here


Solution

  • I figured it out. The whole time I though TFS uses Visual Studio's NuGet, however it turns out TFS runs:

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

    I had to open up console and update nuget:

    nuget.exe update -self