title: Installing a netstandard 2.0 NuGet package: Could not load file or assembly System.Runtime.Extensions
body: <p>I have a little project I'm working on that is available as a NuGet package: Richiban.CommandLine. (You can see the source at <a href="https://github.com/Richiban/CommandLine" rel="nofollow noreferrer">https://github.com/Richiban/CommandLine</a>).</p>
  
  <p>The Richiban.CommandLine library targets netstandard 2.0. In the same solution it is being consumed by several other projects targeting .NET 4.7.1 and everything is fine. </p>
  
  <p>If, however, you install the package through NuGet, you'll invariably get the following Exception:</p>
  
  <blockquote>
    <p>'Could not load file or assembly 'System.Runtime.Extensions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'</p>
  </blockquote>
  
  <p>I am new to netstandard so I'm at a bit of a loss here. Why does everything work fine through project references, but not NuGet?</p>
  
  <p>For reference, here's my package's nuspec file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"&gt;
    &lt;metadata&gt;
      &lt;id&gt;Richiban.CommandLine&lt;/id&gt;
      &lt;version&gt;0.2.0&lt;/version&gt;
      &lt;authors&gt;Richiban.CommandLine&lt;/authors&gt;
      &lt;owners&gt;Richiban.CommandLine&lt;/owners&gt;
      &lt;requireLicenseAcceptance&gt;false&lt;/requireLicenseAcceptance&gt;
      &lt;description&gt;Package Description&lt;/description&gt;
      &lt;dependencies&gt;
        &lt;group targetFramework=".NETStandard2.0" /&gt;
      &lt;/dependencies&gt;
    &lt;/metadata&gt;
  &lt;/package&gt;
  </code></pre>
  
  <p>I'm not referencing any dependencies in this project except for some Fody weavers which are marked as </p>
  
  <pre><code>  &lt;PrivateAssets&gt;all&lt;/PrivateAssets&gt;
  </code></pre>
  
  <p>since they have no runtime components and don't need any binaries to be present.</p>
  
  <p>What have I done wrong?</p>