title: System.Net.Http - Could not load file or assembly, then Cannot load a reference assembly for execution
body: <p>When I publish a csproj I get the message:</p>
  
  <p>Could not load file or assembly System.Net.Http</p>
  
  <p>If I add it to the project and republish, I get the message:</p>
  
  <p>[BadImageFormatException: Cannot load a reference assembly for execution.]
  [BadImageFormatException: Could not load file or assembly 'System.Net.Http'</p>
  
  <p>So it's like catch-22</p>
  
  <p>This is the system.web of my web.config</p>
  
  <pre><code>  &lt;system.web&gt;
      &lt;customErrors mode="Off" /&gt;
      &lt;compilation debug="true" targetFramework="4.7.2" /&gt;
      &lt;httpRuntime targetFramework="4.6" /&gt;
    &lt;/system.web&gt;
  </code></pre>