Cannot load a reference assembly for execution from a Web-Site project : <p>Using .NET 4.6.2 and an older Web-Site (not Web-Application) project. If I clear the BIN directory and then build and run it works, but sometimes after multiple builds and runs, it fails with this error.</p>

<pre><code>Server Error in '/' Application.
Cannot load a reference assembly for execution.
....
[BadImageFormatException: Cannot load a reference assembly for execution.]
[BadImageFormatException: Could not load file or assembly 'netfx.force.conflicts' or 
one of its dependencies. Reference assemblies should not be loaded for execution.  
They can only be loaded in the Reflection-only loader context.
(Exception from HRESULT: 0x80131058)]
....
</code></pre>

<p>Is there any trick to getting Web-Site projects to work correctly when the libraries they use are beginning to pull in netstandard 2.0?</p>

<p>Also, it seems that this assembly binding redirect is necessary to get it to run but nuget adds a redirect to an older version 4.1.1.0. Any suggestions on how to fix that other than manually editing this line after most nuget updates?</p>

<pre><code>  &lt;dependentAssembly&gt;
    &lt;assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a"
                      culture="neutral" /&gt;
    &lt;bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /&gt;
  &lt;/dependentAssembly&gt;
</code></pre>

<p>Would all these issues go away if the project was migrated to a Web-Application project?</p>
