NuGet Package Restore not working as expected

When I attempt to use the NuGet Installer command to perform a package restore, I end up with numerous NuGet packages that cannot be found/located, thus causing my builds to break.

I am using using NuGet Automatic Package Restore as outlined in this article: https://docs.nuget.org/consume/package-restore#ignore-the-nuget-packages-folder-in-the-root-of-the-repository

Therefore, none of my packages are being stored in Team Foundation Server source control.

If I simply build the solution on my local machine using Visual Studio 2013, the NuGet packages restore correctly.

However, as soon as I attempt to use the NuGet Installer to restore packages, it inevitably fails on a large variety of NuGet packages such as the following:

[12:05:54][restore] Registered additional extensions from paths: D:\TeamCity\buildAgent\plugins\nuget-agent\bin\plugins-2.8
[12:05:54][restore] Starting NuGet.exe 2.8.60717.93 from D:\TeamCity\buildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe
[12:05:55][restore] Unable to find version '6.1.1' of package 'EntityFramework'.
[12:05:55][restore] Unable to find version '5.2.0' of package 'Microsoft.AspNet.WebApi'.
[12:05:55][restore] Unable to find version '5.2.0' of package 'Microsoft.AspNet.WebApi.Client'.
[12:05:55][restore] Unable to find version '5.2.0' of package 'Microsoft.AspNet.WebApi.Core'.
[12:05:55][restore] Unable to find version '5.2.0' of package 'Microsoft.AspNet.WebApi.WebHost'.
[12:05:55][restore] Unable to find version '0.9.0' of package 'Strathweb.CacheOutput.WebApi2'.
[12:05:55][restore] Unable to find version '4.0.2.206221351' of package 'System.IdentityModel.Tokens.Jwt'.
[12:05:55][restore] Unable to find version '3.2.1' of package 'AutoMapper'.
[12:05:55][restore] Unable to find version '4.5.3' of package 'ckeditor-standard'.
[12:05:55][restore] Unable to find version '6.1.1' of package 'EntityFramework.SqlServerCompact'.
[12:05:55][restore] Unable to find version '2.1.4' of package 'jQuery'.
[12:05:55][restore] Unable to find version '4.0.8854.1' of package 'Microsoft.SqlServer.Compact'.
[12:05:55][restore] Unable to find version '4.2.1409.1722' of package 'Moq'.



I am using the latest version of NuGet v. 2.8.6 with TeamCity 9.1.3.



Please advise as to how to resolve this problem.


Thanks.  
1 comment
Comment actions Permalink

Hi Samir,

How do you run NuGet restore, what NuGet Packages Sources do you use? Please attach screenshot of the build step settings.

0

Please sign in to leave a comment.