title: Error when installing nuget package from VSTS feed
body: <p>I have a build in VSTS which as a first step installs nuget packages from VSTS Feed and fails doing so. Restore works well, but according to nuget <a href="https://docs.nuget.org/ndocs/consume-packages/reinstalling-and-updating-packages" rel="nofollow noreferrer">doc</a> install command provides the latest package from given version range. Restore provides the given version, not the latest, as far as I experienced so far.</p>
  
  <p>Have you already met this issue?</p>
  
  <p><strong>Update</strong>: I reported this <a href="https://github.com/Microsoft/vsts-tasks/issues/3862" rel="nofollow noreferrer">issue</a> to the <a href="https://github.com/Microsoft/vsts-tasks" rel="nofollow noreferrer">vsts-tasks</a> team.</p>
  
  <p>Error message:</p>
  
  <pre><code>2016-11-24T13:42:38.8093462Z Feeds used:
  2016-11-24T13:42:38.8093462Z   https://api.nuget.org/v3/index.json
  2016-11-24T13:42:38.8103475Z   https://sayusiando.../_packaging/.../nuget/v3/index.json
  2016-11-24T13:42:38.8103475Z   C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
  2016-11-24T13:42:38.8103475Z 
  2016-11-24T13:42:39.2778332Z Using credentials from config. UserName: VssSessionToken
  2016-11-24T13:42:40.1439116Z NuGet.Protocol.Core.Types.NuGetProtocolException: An error occurred while retrieving package metadata for 'C:\a\1\s\src\DigitalLibrary.sln' from source 'DigitalLibraryNuget'. ---&gt; System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
  2016-11-24T13:42:40.1439116Z    at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
  2016-11-24T13:42:40.1439116Z    at NuGet.Protocol.Core.v3.DependencyInfo.Utils.&lt;LoadResource&gt;d__3.MoveNext()
  2016-11-24T13:42:40.1439116Z --- End of stack trace from previous location where exception was thrown ---
  2016-11-24T13:42:40.1439116Z    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  2016-11-24T13:42:40.1439116Z    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  2016-11-24T13:42:40.1439116Z    at NuGet.Protocol.Core.v3.DependencyInfo.Utils.&lt;LoadRanges&gt;d__4.MoveNext()
  2016-11-24T13:42:40.1439116Z --- End of stack trace from previous location where exception was thrown ---
  2016-11-24T13:42:40.1439116Z    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  2016-11-24T13:42:40.1439116Z    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  2016-11-24T13:42:40.1439116Z    at NuGet.Protocol.Core.v3.DependencyInfo.ResolverMetadataClient.&lt;GetDependencies&gt;d__0.MoveNext()
  2016-11-24T13:42:40.1439116Z --- End of stack trace from previous location where exception was thrown ---
  2016-11-24T13:42:40.1439116Z    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  2016-11-24T13:42:40.1439116Z    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  2016-11-24T13:42:40.1439116Z    at NuGet.Protocol.Core.v3.DependencyInfo.ResolverMetadataClient.&lt;GetRegistrationInfo&gt;d__2.MoveNext()
  2016-11-24T13:42:40.1439116Z --- End of stack trace from previous location where exception was thrown ---
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  2016-11-24T13:42:40.1449094Z    at NuGet.Protocol.Core.v3.DependencyInfoResourceV3.&lt;ResolvePackages&gt;d__5.MoveNext()
  2016-11-24T13:42:40.1449094Z    --- End of inner exception stack trace ---
  2016-11-24T13:42:40.1449094Z    at NuGet.Protocol.Core.v3.DependencyInfoResourceV3.&lt;ResolvePackages&gt;d__5.MoveNext()
  2016-11-24T13:42:40.1449094Z --- End of stack trace from previous location where exception was thrown ---
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  2016-11-24T13:42:40.1449094Z    at NuGet.PackageManagement.NuGetPackageManager.&lt;GetLatestVersionCoreAsync&gt;d__65.MoveNext()
  2016-11-24T13:42:40.1449094Z --- End of stack trace from previous location where exception was thrown ---
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  2016-11-24T13:42:40.1449094Z    at NuGet.PackageManagement.NuGetPackageManager.&lt;&gt;c__DisplayClass64_1.&lt;&lt;GetLatestVersionAsync&gt;b__0&gt;d.MoveNext()
  2016-11-24T13:42:40.1449094Z --- End of stack trace from previous location where exception was thrown ---
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  2016-11-24T13:42:40.1449094Z    at NuGet.PackageManagement.NuGetPackageManager.&lt;GetLatestVersionAsync&gt;d__64.MoveNext()
  2016-11-24T13:42:40.1449094Z --- End of stack trace from previous location where exception was thrown ---
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  2016-11-24T13:42:40.1449094Z    at NuGet.PackageManagement.NuGetPackageManager.&lt;GetLatestVersionAsync&gt;d__63.MoveNext()
  2016-11-24T13:42:40.1449094Z --- End of stack trace from previous location where exception was thrown ---
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  2016-11-24T13:42:40.1449094Z    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  2016-11-24T13:42:40.1449094Z    at NuGet.CommandLine.InstallCommand.&lt;InstallPackage&gt;d__34.MoveNext()
  2016-11-24T13:42:40.1699089Z ##[error]Error: C:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.24\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1
  2016-11-24T13:42:40.1699089Z ##[error]Packages failed to install
  </code></pre>