Determine framework (CLR) version of assembly

后端 未结 12 2305
生来不讨喜
生来不讨喜 2020-11-27 03:46

From the command line (or by any means really), how can I determine which CLR version a .NET assembly requires?

I need to determine if an assembly requires 2.0 or 4

12条回答
  •  無奈伤痛
    2020-11-27 04:07

    I'd suggest using ReflectionOnlyLoadFrom() insted of LoadFrom()

    It has an advantage that it can load x64 and ia64 assemblies when running on x86 machine, while LoadFrom() will fail to do that.

    Though it still won't load .Net 4.0 assemblies from a 2.0 powershell.

提交回复
热议问题