title: Force Microsoft Build Tools 2015 to include mscorlib for the targeted version of the framework instead of 4.6
body: <p>I have written an application in Visual Studio 2015 that uses C# 6.0 features and targets .NET 4.5.2. When I build it using Microsoft Build Tools 2015, which is what is done by our TeamCity server, the resulting bin folder also contains a copy of <code>mscorlib.dll</code>. The problem here is that the  <code>mscorlib.dll</code> being copied is the .NET 4.6 DLL, which causes problems at runtime.</p>
  
  <p>I have replaced my call to <code>string.Format()</code> with the new string interpolation syntax to work around the problem. That, however, shoves the underlying problem under the carpet instead of addressing it: Why is the .NET 4.6 DLL included in my build and how can I force the 4.5.2 DLL to be included in its place?</p>
  
  <p>If you are interested in the runtime problem this caused for me, it caused my:</p>
  
  <pre><code>string.Format(CultureInfo.InvariantCulture, "{0}='{1}'", "key", "value")
  </code></pre>
  
  <p>To be interpreted as (<a href="https://msdn.microsoft.com/en-us/library/dn906223(v=vs.110).aspx" rel="noreferrer">link</a> -- which only exists in .NET 4.6):</p>
  
  <pre><code>System.String System.String.Format(System.IFormatProvider, System.String, System.Object, System.Object)
  </code></pre>
  
  <p>Instead of (<a href="https://msdn.microsoft.com/library/1ksz8yb7(v=vs.110).aspx" rel="noreferrer">link</a>):</p>
  
  <pre><code>System.String System.String.Format(System.IFormatProvider, System.String, params System.Object[])
  </code></pre>