Why does an assembly compiled specifically for 3.5 show up as having a target runtime of 2.0 (2.0.50727)?
Apparently some of the assemblies in 3.5 are still older 2.0, but I would think that .net reflector would iterate through the references and report the highest .net runtime target encountered - as that would truly be the actual runtime.
!noital
0

Comments

5 comments

  • Clive Tong
    The Target Runtime value is a string that is included in the general metadata header. Reflector just reads it out of the assembly and reports it to the user without changing it.

    Applications compiled against .NET 3.5 still run on top of the 2.0 version of the CLR, hence the assembly is targetting the 2.0 CLR.
    Clive Tong
    0
  • !noital
    That makes sense - but it's still wrong. When you set the target environment to 3.5 then some of the assemblies necessary to run the application (such as system.core.dll) must be 3.5 or the app will not run. So even though the header says 2.0 - the application will not run - so a better way to Identify the target runtime needs to be found - or it's not really a useful thing to even bother showing.

    Des
    !noital
    0
  • Alex D
    The target runtime is a different thing to the target framework. When you have a target framework of 3.5 in VS, you're asking for a target runtime of 2.0 and to reference the 3.5 framework assemblies (like system.core).

    Reflector is showing you exactly what is in your assembly.

    If you want to know whether something has a target framework of 2.0 or 3.5, you need to look at the assemblies it references.
    Alex D
    0
  • JohaViss
    If you want to know whether something has a target framework of 2.0 or 3.5, you need to look at the assemblies it references.

    This is why we need a tool.
    If we have to check everthing ourselves, we don't need Relector.

    Regards,
    Johan Visser

    P.S.
    Make the add-in dialog resizable. (And sortable)
    It is not very user friendly now.
    JohaViss
    0
  • !noital
    Ok - in the end then, target runtime does not appear to be a useful metric. Sure - reflector is doing it's job, but the information isn't useful - and the subtle difference between Target Runtime and Target Framework will clearly confuse people.
    This simply means .NET Reflector isn't really the tool for this.
    !noital
    0

Add comment

Please sign in to leave a comment.