title: Nuget packages are not restored
body: <p>I cloned project from Gitub. My solution has 6 projects and every project has packages.config file (which has listing of packages along with their versions) but these packages are not restored.</p>
  
  <p><strong>Methods I already tried to restore nuget packages:</strong></p>
  
  <ol>
  <li>In Visual Studio: <code>Tools -&gt; Options -&gt; Nuget Package Manger -&gt; General</code> and checked both options.</li>
  <li>Write Following Code in <code>web.config</code> file:</li>
  </ol>
  
  <p><code>&lt;packageRestore&gt;
      &lt;!-- The 'enabled' key is True when the "Allow NuGet to download missing packages" checkbox is set.
               Clearing the box sets this to False, disabling command-line, automatic, and MSBuild-Integrated restore. --&gt;
      &lt;add key="enabled" value="True" /&gt;
    &lt;/packageRestore&gt;</code></p>
  
  <p>This restored packages for that project, but other projects don't have web.config file.</p>
  
  <ol start="3">
  <li>Added following code in <code>%AppData%\NuGet\NuGet.Config</code>:</li>
  </ol>
  
  <p><code>&lt;configuration&gt;
      &lt;packageRestore&gt;
          &lt;!-- The 'automatic' key is set to True when the "Automatically check for missing packages during
               build in Visual Studio" checkbox is set. Clearing the box sets this to False and disables
               automatic restore. --&gt;
          &lt;add key="automatic" value="True" /&gt;
      &lt;/packageRestore&gt;
  &lt;/configuration&gt;</code>
  (<a href="https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore" rel="nofollow noreferrer">source</a>)</p>
  
  <ol start="4">
  <li>Run this command in Package Manager Console: <code>Update-Package –reinstall</code>
  It said this for all the packages:</li>
  </ol>
  
  <p><code>Package 'Abp.2.1.2' already exists in project 'TempABP5.Migrator'
  Successfully installed 'Abp 2.1.2' to TempABP5.Migrator</code></p>
  
  <ol start="5">
  <li><p>Created a <code>NuGet.Config</code> file next to your <code>.sln</code> file, containing:</p>
  
  <p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;packageSources&gt;
      &lt;add key="nuget.org" value="https://www.nuget.org/api/v2/" /&gt;
      &lt;add key="aspnetwebstacknightlyrelease" value="https://www.myget.org/f/aspnetwebstacknightlyrelease/" /&gt;
    &lt;/packageSources&gt;
  &lt;/configuration&gt;</code></p></li>
  </ol>
  
  <p>(<a href="http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html" rel="nofollow noreferrer">source</a>)</p>
  
  <ol start="6">
  <li>Tested by removing following code from <code>.csproj</code> file:</li>
  </ol>
  
  <p><code>&lt;Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"&gt;
    &lt;PropertyGroup&gt;
      &lt;ErrorText&gt;This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.&lt;/ErrorText&gt;
    &lt;/PropertyGroup&gt;
    &lt;Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" /&gt;
  &lt;/Target&gt;</code>  (<a href="https://stackoverflow.com/a/35101739/3952692">source</a>)</p>
  
  <p>But still I cannot restore packages and project fails to build. How can I restore missing packages?</p>
  
  <p><strong>Updated:</strong></p>
  
  <p>Below image contains the screen shot of project and errors:<a href="https://i.stack.imgur.com/8EpkO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8EpkO.png" alt="enter image description here"></a></p>
  
  <p>I deleted all data in bin/obj folders and then clean solution and then build but same errors..</p>
  
  <p>Then I again run the command <code>Update-Package –reinstall</code> to make sure that packages already exists and the result is:</p>
  
  <p><a href="https://i.stack.imgur.com/zq055.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zq055.png" alt=""></a>
  <a href="https://i.stack.imgur.com/r8Pau.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r8Pau.png" alt=""></a></p>