title: Retrieve Target Framework Version and Target Framework Profile from a .Net Assembly
body: <p>Is there any way that I can access the values that were used for TargetFrameworkVersion and/or TargetFrameworkProfile when a .Net assembly was compiled?</p>
  <p>The values I'm talking about are the ones contained the project file</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;Project ToolsVersion=&quot;4.0&quot; DefaultTargets=&quot;Build&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
    &lt;PropertyGroup&gt;
      &lt;OtherStuff /&gt;
      &lt;TargetFrameworkVersion&gt;v4.0&lt;/TargetFrameworkVersion&gt;
      &lt;TargetFrameworkProfile&gt;Client&lt;/TargetFrameworkProfile&gt;
      &lt;OtherStuff /&gt;
    &lt;/PropertyGroup&gt;
    &lt;OtherStuff&gt;
    &lt;/OtherStuff&gt;
  &lt;/Project&gt;
  </code></pre>
  <p>Basically I'd like to find out what the Target Version of the Framework was when the assembly was compiled and if possible the Target Framework Profile as well.</p>
  <p>And I'm not talking about the currently loaded version of the CLR, <a href="http://msdn.microsoft.com/en-us/library/system.environment.version.aspx" rel="nofollow noreferrer">Environment.Version</a> isn't what I'm after.</p>
  <p>Ideally the solution would use System.Reflection but if I have to resort to other methods I will.</p>