Determine framework (CLR) version of assembly

后端 未结 12 2310
生来不讨喜
生来不讨喜 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:03

    If you want to include result in a script, I recommend using the text output of ildasm.exe, and then grep "Version String" from the output.

    "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\ildasm.exe" /text D:\LocalAssemblies\Toolfactory.Core.BaseTypes.dll /noil /headers | find "' Version String"
    

    Note I include a ' so the find command does not recognize "Version String Length"

提交回复
热议问题