title: Jenkins not restoring NuGet packages with new MSBuild restore target
body: <p>We have a .net full framework WPF application that we've moved from <strong>.net 4.6.2 to 4.7.1</strong> along with changing to <strong>PackageReference</strong> in the csproj file instead of packages.config.</p>
  
  <p>Building on the development machines appears to be fine and packages are downloaded and restored, but when we build on our <strong>Windows Server 2012 build server with Jenkins</strong>, the nuget packages don't seem to be restored correctly.</p>
  
  <p>We're using <strong>MSBuild v15.5</strong> with the latest <strong>"msbuild /restore"</strong> command to restore packages at build time. 
  Note: Using the previous way of calling "nuget restore" <strong>does</strong> work, but we should be able to use <a href="https://github.com/Microsoft/msbuild/pull/2414" rel="noreferrer">msbuild /restore now</a>.</p>
  
  <p>The package restore process appears to be looking at the correct NuGet servers and appears to go through the restore without errors (this is a test solution compiled on Jenkins to isolate the issue):</p>
  
  <pre><code>Restore:
    Restoring packages for c:\Jenkins\workspace\Test\ConsoleApp1\ConsoleApp1.csproj...
    Committing restore...
    Generating MSBuild file c:\Jenkins\workspace\Test\ConsoleApp1\obj\ConsoleApp1.csproj.nuget.g.props.
    Generating MSBuild file c:\Jenkins\workspace\Test\ConsoleApp1\obj\ConsoleApp1.csproj.nuget.g.targets.
    Writing lock file to disk. Path: c:\Jenkins\workspace\Test\ConsoleApp1\obj\project.assets.json
    Restore completed in 577.05 ms for c:\Jenkins\workspace\Test\ConsoleApp1\ConsoleApp1.csproj.
  
    NuGet Config files used:
        c:\Jenkins\workspace\Test\NuGet.Config
        C:\Windows\system32\config\systemprofile\AppData\Roaming\NuGet\NuGet.Config
  
    Feeds used:
        http://devbuild/NuGetHost/nuget
        https://api.nuget.org/v3/index.json
  Done Building Project "c:\Jenkins\workspace\Test\ConsoleApp1.sln" (Restore target(s)).
  </code></pre>
  
  <p>But when msbuild comes to compile the code we get the following errors which looks like the NuGet hasn't been downloaded:</p>
  
  <pre><code>CSC : error CS0006: Metadata file 'C:\Windows\system32\config\systemprofile\.nuget\packages\log4net\2.0.8\lib\net45-full\log4net.dll' 
  could not be found [c:\Jenkins\workspace\Test\ConsoleApp1\ConsoleApp1.csproj]
  </code></pre>
  
  <p>Any idea why the nuget packages aren't getting restored?</p>