none
Version of .NET RRS feed

  • Question

  • Is there a way to determine which version of .NET was used to build an executable?  
    Tuesday, February 24, 2009 4:47 PM

Answers

  • The CLR version and the .NET version haven't been similar for quite a while.  You'll find 2.0.50727 for .NET 2.0, 3.0, 3.5 and 3.5 SP1.  What really counts is what other .NET assemblies are being used by a binary.  You could take a peek with Assembly.GetReferencedAssemblies().  Other than that, it isn't .NET that builds an executable, it is a specific compiler.
    Hans Passant.
    • Proposed as answer by thomas_woelfer Wednesday, February 25, 2009 10:50 AM
    • Marked as answer by Zhi-Xin Ye Tuesday, March 3, 2009 9:14 AM
    Wednesday, February 25, 2009 1:09 AM
    Moderator

All replies

  • The following 2 methods help you to find 'runtime version' used to build an app:
    + If you want to find it out via some APIs, you can use Assembly property:  Assembly.ImageRuntimeVersion
    + If you just want to check, you can ildasm the assembly and look at the Manifest information. The first line tells you the metadata version, which is the CLR version used.
        ildasm.exe myassembly.dll


    This blog answers your question:

    http://social.msdn.microsoft.com/Forums/en-US/clr/thread/a6384005-4464-439b-8125-60a099d2c6bf/

    Tuesday, February 24, 2009 8:14 PM
  • The CLR version and the .NET version haven't been similar for quite a while.  You'll find 2.0.50727 for .NET 2.0, 3.0, 3.5 and 3.5 SP1.  What really counts is what other .NET assemblies are being used by a binary.  You could take a peek with Assembly.GetReferencedAssemblies().  Other than that, it isn't .NET that builds an executable, it is a specific compiler.
    Hans Passant.
    • Proposed as answer by thomas_woelfer Wednesday, February 25, 2009 10:50 AM
    • Marked as answer by Zhi-Xin Ye Tuesday, March 3, 2009 9:14 AM
    Wednesday, February 25, 2009 1:09 AM
    Moderator