title: How do I detect at runtime that .NET version 4.5 is currently running your code?
body: <p>I installed .NET 4.5 Developer preview from <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=27541" rel="noreferrer">http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=27541</a>, which 'replaces' .NET 4.0 version.</p>
  
  <p>However, the old way to detect the .NET framework version seems to return 4.0 (more precisely 4.0.30319.17020 on my PC), instead of 4.5 (sure probably for backward compatibility, or?):</p>
  
  <pre><code>using System;
  
  namespace ConsoleApplication
  {
      class Program
      {
          static void Main(string[] args)
          {
              var version = Environment.Version;
              Console.WriteLine(version.ToString());
              Console.ReadKey();
          }
      }
  }
  </code></pre>
  
  <p>How do I detect that my code is really executed by .NET 4.5?</p>