Condition: package is not in local cache
Nuget.exe version 2.7.40906.75
See attached image for screen shot, but here is the jist
run:
nuget install packages.config -verbosity detailed
outputs:
Get https://www.nuget.org/api/v2/Packages<(Id='Moq,Version='4.1.1309.919')
System.InvalidOperationException: Unable to fine version '4.1.1309.0919' of package 'Moq'.
Note that the Get is using "919" and the error is using "0919".
The problem is that Moq is using an invalid version if you assume that each version segment number must be a short.
Nuget may still want to handle this scenario because it took us a couple of days to identify the issue.
The issue reveals itself in NuGet.VersionExtensions.cs in the AddVersionToList(string, LinkedList<string>, string) method. Because of the way the nextVersion string is constructed the leading zeros are dropped which causes the originalVersion and nextVersion to not be equal.
-------------------
packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Moq" version="4.1.1309.0919" targetFramework="net45" />
<package id="Unity" version="3.0.1304.1" targetFramework="net45" />
</packages>