title: Automatic Package Restore: Unable to find version of package
body: <p>We are using the improved <a href="http://docs.nuget.org/docs/reference/package-restore" rel="noreferrer">Automatic Package Restore</a> process to restore missing NuGet packages.</p>
  
  <p>When building, the Restore dialog pops up as it starts to download from the package sources, which is correct:</p>
  
  <p><img src="https://i.stack.imgur.com/EVHfl.png" alt="Restore Dialog"></p>
  
  <p>I can see that the packages are being restored into the packages folder, but it doesn't finish restoring all of them.  I get the following kind of errors:</p>
  
  <pre><code>Error   10  NuGet Package restore failed for project MyProject: System.InvalidOperationException: Unable to find version '6.0.1' of package 'Newtonsoft.Json'.
     at NuGet.PackageHelper.ResolvePackage(IPackageRepository repository, String packageId, SemanticVersion version)
     at NuGet.VsEvents.PackageRestorer.RestorePackage(PackageReference package)
     at NuGet.VsEvents.PackageRestorer.RestorePackages(String packageReferenceFileFullPath, IFileSystem fileSystem)
     at NuGet.VsEvents.PackageRestorer.PackageRestore(ProjectPackageReferenceFile projectPackageReferenceFile).
  </code></pre>
  
  <p><strong>Could this be because I have multiple package sources?</strong>  </p>
  
  <p><img src="https://i.stack.imgur.com/yNel2.png" alt="enter image description here"></p>
  
  <p>NuGet may be searching in our private package source for the 'Newtonsoft.Json', for example, and not in the <code>nuget.org</code> source.</p>
  
  <p>The <code>.nuget/NuGet.config</code> file:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;packageSources&gt;
      &lt;add key="nuget.org" value="https://www.nuget.org/api/v2/" /&gt;
      &lt;add key="private" value="http://privatePackageSource.com/nuget" /&gt;
    &lt;/packageSources&gt;
    &lt;solution&gt;
      &lt;add key="disableSourceControlIntegration" value="true" /&gt;
    &lt;/solution&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>We are using Visual Studio 2013 and NuGet 2.8.5.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Using Fiddler, I have confirmed that NuGet is indeed searching for the packages in the incorrect source.  It is requesting the following packages from my private repository.</p>
  
  <p>I also read <a href="http://docs.myget.org/docs/how-to/package-not-found-during-package-restore" rel="noreferrer">this post</a> and added the <code>activePackageSource</code> section to the <code>NuGet.config</code> file:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;packageSources&gt;
      &lt;add key="nuget.org" value="https://www.nuget.org/api/v2/" /&gt;
      &lt;add key="private" value="http://privatePackageSource.com/nuget" /&gt;
    &lt;/packageSources&gt;
    &lt;activePackageSource&gt;
      &lt;add key="All" value="(Aggregate source)" /&gt;
    &lt;/activePackageSource&gt;
    &lt;solution&gt;
      &lt;add key="disableSourceControlIntegration" value="true" /&gt;
    &lt;/solution&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>But it doesn't fix the problem.</p>