title: Multiple assembly conflict with NuGet System references
body: <p>I have a project that references <a href="https://www.nuget.org/packages/CommandLineParser/2.3.0" rel="nofollow noreferrer">this NuGet package.</a> The package has several framework references (e.g., <code>System.Collections</code>). My project is targeting .NET Framework 4.6.2, and I have the .NET 4.6.2 targeting pack installed on my build machine.</p>
  
  <p>When I install the NuGet package in Visual studio, it also installs dependencies for all the framework packages, so my <code>packages.config</code> ends up looking like this</p>
  
  <pre><code>&lt;packages&gt;
    &lt;package id="CommandLineParser" version="2.3.0" targetFramework="net462" /&gt;
    &lt;package id="System.Collections" version="4.3.0" targetFramework="net462" /&gt;
    &lt;package id="System.Console" version="4.0.0" targetFramework="net462" /&gt;
    &lt;package id="System.Diagnostics.Debug" version="4.0.11" targetFramework="net462" /&gt;
    &lt;package id="System.Globalization" version="4.0.11" targetFramework="net462" /&gt;
    &lt;package id="System.IO" version="4.1.0" targetFramework="net462" /&gt;
    &lt;package id="System.Linq" version="4.1.0" targetFramework="net462" /&gt;
    &lt;package id="System.Linq.Expressions" version="4.1.0" targetFramework="net462" /&gt;
    &lt;package id="System.Reflection" version="4.1.0" targetFramework="net462" /&gt;
    &lt;package id="System.Reflection.Extensions" version="4.0.1" targetFramework="net462" /&gt;
    &lt;package id="System.Reflection.TypeExtensions" version="4.1.0" targetFramework="net462" /&gt;
    &lt;package id="System.Resources.ResourceManager" version="4.0.1" targetFramework="net462" /&gt;
    &lt;package id="System.Runtime" version="4.1.0" targetFramework="net462" /&gt;
    &lt;package id="System.Runtime.Extensions" version="4.1.0" targetFramework="net462" /&gt;
  &lt;/packages&gt;
  </code></pre>
  
  <p>I've read that this is because the package targets .NET Standard, which will automatically import all these packages even if they are present on the machine.</p>
  
  <p>So far, everything is fine, and I can build the project on my machine. However, on the build server, I get the following error</p>
  
  <blockquote>
    <p>CSC : error CS1703: Multiple assemblies with equivalent identity have been imported: 'C:\Jenkins\jobs\MyProject\workspace\packages\System.Runtime.Extensions.4.1.0\lib\net462\System.Runtime.Extensions.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.2\Facades\System.Runtime.Extensions.dll'. Remove one of the duplicate references.</p>
  </blockquote>
  
  <p>The build server also has the .NET 4.6.2 targeting pack installed. Moreover, on my dev machine, I also have the file</p>
  
  <pre><code>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\Facades\System.Runtime.Extensions.dll
  </code></pre>
  
  <p>as well as all the other facade system files.</p>
  
  <p>So my question is, why does this fail on my build server? It seems like all the same versions of .NET are installed, and I'm not sure what else to check.</p>