TFS 2017 Update 1, Nuget Restore task always fails trying to find packages even though they exist on the feed.
We have come across a couple of cases where the Nuget Restore task in TFS 2017 Update 1 would fail when used with the internal Packages feed.
The task would fail along the lines of,
2017-04-18T01:40:36.7838703Z Feeds used:
2017-04-18T01:40:36.7838703Z C:\Users\bldacc\AppData\Local\NuGet\Cache
2017-04-18T01:40:36.7838703Z C:\Users\bldacc\.nuget\packages\
2017-04-18T01:40:36.7838703Z https://server.com/Collection/\_packaging/../../nuget/v3/index.json
2017-04-18T01:40:36.7838703Z
2017-04-18T01:40:36.9860291Z Restoring NuGet package MyPack.Framework.11.0.1.
2017-04-18T01:40:37.1287365Z WARNING: Unable to find version '11.0.1' of package MyPack.Framework'.
2017-04-18T01:40:37.1413490Z Unable to find version '11.0.1' of package MyPack.Framework'
The version of the task is verified to be on the feed. This is an issue with the 3.3.0 task.
This could be resolved by using the latest version of Nuget on the task (3.5.0) at the time of this writing.
Unfortunately 3.3 doesn’t really give us any usable diagnostic information (it reports ‘unable to find version’ if anything at all goes wrong while restoring a package)Please consider using the latest version of the task as it gives more details on the error.
Content: Manigandan Balachandran
Review: Romit Gulati
Comments
- Anonymous
April 18, 2017
Thanks for sharing. We ran into this as well after upgrading to TFS 2017.1. Another, semi-related, issue we are seeing is with the "NuGet Packager" task, which runs into the following issue as the build agent is using NuGet 3.4.3:https://github.com/NuGet/Home/issues/2648Looking into this further, it looks like the NuGet Restore build task includes its own versions of NuGet (3.3 & 3.5), whereas the NuGet Packager relies on the version that comes with the build agent (v3.4.3 for TFS 2017.1).Per this article (http://blog.majcica.com/2016/11/02/custom-nuget-exe-for-tfs-2015-build/), I can specify a newer NuGet version on a build agent, but then all developers using the agent(s) have to touch all their build definitions as well to avoid the bug.Is there a better way to update the build agent's NuGet version without pushing additional overhead to our developer base?Thanks,Matt