title: How to find out Target framework name and version from exe?
body: <p>I have some exe files which has been created using either .net framework 4.5 or .net core 2.1 or .net core 3.1.</p>
  
  <p>I want to get framework name and version information from this DLL using only c# application.</p>
  
  <p>I have written below piece of code which is beneficial and works great with DLL files but not with exe.</p>
  
  <pre><code>var dllInformation = Assembly.LoadFrom(@"D:\\MyProgram.dll");
  Console.WriteLine(dllInformation.FullName);
  Console.WriteLine(dllInformation.ImageRuntimeVersion);
  Console.WriteLine(((TargetFrameworkAttribute)dllInformation.GetCustomAttributes(typeof(TargetFrameworkAttribute)).First()).FrameworkName);
  </code></pre>
  
  <p>I have also gone through these links but I didn't found them useful for exe files:</p>
  
  <p><a href="https://stackoverflow.com/questions/1388178/information-from-exe-file">information from exe file</a></p>
  
  <p><a href="https://stackoverflow.com/questions/3460982/determine-net-framework-version-for-dll">Determine .NET Framework version for dll</a></p>
  
  <p>Please let me know if any suggestions available.</p>