title: Why does VS2015 allow C# 6.0 functions for .Net 4.5.2 applications?
body: <p>I'm getting a strange behavior in Visual Studio 2015. I'm writting an application targeting 4.5.2 .Net Framework:</p>
  
  <p><a href="https://i.stack.imgur.com/bwdh3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bwdh3.png" alt=".Net version"></a></p>
  
  <p>Then in the application, I try use some things which were implemented in C# 6.0 (which is from .Net 6.0) :</p>
  
  <pre><code>int number = 456;
  var name = nameof(number);
  string str = $"Time = {DateTime.Now}";
  </code></pre>
  
  <p>I'm quite sure that <code>nameof</code> and string formatting using <code>$</code> are only available in .Net 4.6, but still I'm able to compile this code - event though I'm targeting 4.5.2.</p>
  
  <p>I've run the same code in Visual Studio 2013, also targeting the 4.5.2 version, but this time I can't compile the code (<code>nameof</code> not found). </p>
  
  <p>How is it possible, that VS2015 allowed me to compile the code which shouldn't be allowed in target .Net Framework version? </p>
  
  <p>My shoot in the dark is that the VS2015 is capable of computing the C# 6.0 code into the CIL which is still compatible with previous versions, but I'm not sure if it's the right guess.</p>