1

The packages restore fine on the developer PC and using Visual Studio on the build server. When performing an automated build using TFS, however, many of the packages fail with a messages like these:

WARNING: Unable to find version '5.0.4' of package 'Newtonsoft.Json'.
WARNING: Unable to find version '1.2.2' of package 'Microsoft.Net.Compilers'.

Other packages work fine:

Added package 'WebGrease.1.5.2' to folder 'E:\d\w\50\s\NHXS.Web.RemittanceManager\packages'

I tried using -verbosity detailed to get more information, but it didn't help. I know some people have had success by updating the NuGet config to use version 3 of the NuGet API, but given that some of the packages work - it seems like this wouldn't be the issue. (And I don't want to break a production build server for other users). Is there a way to get more information on the failures?

3
  • Why you think change Nuget API version2 to version3 will break this production build server ? I'm not sure if version3 is fully backward compatible with version2. But generally speak, this should not be a problem. Commented Sep 20, 2016 at 9:47
  • In the verbosity you will find the following lines: NuGet Config files used: C:\Users\tfs\AppData\Roaming\NuGet\NuGet.Config Feeds used: C:\Users\tfs\AppData\Local\NuGet\Cache C:\Users\tfs\.nuget\packages\ api.nuget.org/v3/index.json Are you sure WebGrease.1.5.2 isn't in the cache while the other's aren't? Could someone possibly checked in a different NuGet.Config somewhere in the path of the solution that override the default NuGet.config? Commented Sep 22, 2016 at 11:53
  • What is the package source in your nuget.config file? Commented Sep 26, 2016 at 8:00

2 Answers 2

1

Possible duplicate with this question: "Unable to find version" during TFS Build 2015 when restoring NuGet packages

Please check your nuget install task in your tfs build definition. If you already use V3.0 and the config file are still point to V2.0. You will get this error.

enter image description here

Moreover, since the packages can be restored successfully on you dev PC, you can also compare the nuget.config file on your TFS server and dev PCs to see if there is any difference between them. The nuget.config file locates at "%APPDATA%\NuGet\NuGet.Config".

Sign up to request clarification or add additional context in comments.

Comments

1

This helped me out but I chose to go a different route.

I didn't want to mess with the Nuget.config on our TFS server. Instead I checked in a more recent version of the nuget.exe command line in the solution and adjusted the path to the local copy.

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.