title: Nuget doesn't restore packages for solution, but works when executed for .csproj
body: <p>I've got a legacy project with a somehow faulty configuration for the used nuget packages.</p>
  
  <p>When I try to restore packages with the solution (.sln) the restore doesn't restore anything. Also, the nuget package manager shows no installed packages for the solution. What I tried:</p>
  
  <pre><code>nuget restore the_solution.sln -MSBuildPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" -Verbosity detailed -ConfigFile "C:\Users\jenkins\AppData\Roaming\NuGet\NuGet.Config"
  </code></pre>
  
  <p>But when I restore the packages for each project (.csproj) the restore works fine and the project can be built. The command I call for the project restore is:</p>
  
  <pre><code>nuget restore path_to_project\packages.config -MSBuildPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" -Verbosity detailed  -OutputDirectory "Packages" -ConfigFile "C:\Users\jenkins\AppData\Roaming\NuGet\NuGet.Config"
  </code></pre>
  
  <p>The packages config for each .csproj looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;packages&gt;
    &lt;package id="Autofac" version="4.7.0" targetFramework="net461" /&gt;
    &lt;!- many other packages --&gt;
  &lt;/packages&gt;
  </code></pre>
  
  <p>The .csproj file looks like this:</p>
  
  <pre><code>  &lt;ItemGroup&gt;
      &lt;Reference Include="Autofac, Version=4.7.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL"&gt;
        &lt;HintPath&gt;..\packages\Autofac.4.7.0\lib\net45\Autofac.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
  &lt;!- many other packages --&gt;
  </code></pre>
  
  <p>The RestoreProject Style in the .csproj is set to:</p>
  
  <pre><code>  &lt;PropertyGroup&gt;
        &lt;RestoreProjectStyle&gt;PackageReference&lt;/RestoreProjectStyle&gt;
    &lt;/PropertyGroup&gt;
  </code></pre>
  
  <p>I have no clue, why I can’t use the .sln file for the nuget restore. So, any hint what might causes the error is highly appreciated.</p>