简体   繁体   中英

CI Build on TeamCity Fails due to dependency on Microsoft.Bcl

When I try and build my project in Teamcity (or in a clean repository on my machine), it fails with the error message

The schema version of 'Microsoft.Bcl' is incompatible with version 1.7.30402.9028 of NuGet. Please upgrade NuGet to the latest version from <nuget url>...

I've set my NuGet.Targets to restore packages, and not require user interactions to accept licenses. In addition both my local machine and the build server have the restore packages setting enabled (in the project/env variable as appropriate).

I'm aware of this issue http://blogs.msdn.com/b/dotnet/archive/2013/06/12/nuget-package-restore-issues.aspx . I've tried the second and third options suggested here, but without success.

Does anyone have any suggestions how to resolve this error?

Turns out the version of NuGet that is held in the .nuget folder of my solution was out of date. The version that Visual Studio uses had updated correctly, but the command line version didn't.

I followed the instructions described here Nuget versioning issue with package restore to resolve the problem.

In the solution directory run these commands:

cd .nuget
nuget.exe update -Self

Try updating the nuget that teamcity is using

If you are using version 8.xx

Administration -> Nuget Settings -> Nuget Commandline -> (click fetch nuget) -> then choose the latest version and install it. Make sure "Set as Default" is checked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM