Assembly version from command line?

后端 未结 9 1504
慢半拍i
慢半拍i 2020-12-12 21:35

Is there a Microsoft tool to get the assembly version of a DLL file from a command line?

(I know that I can code my own tool.)

9条回答
  •  隐瞒了意图╮
    2020-12-12 22:26

    I used the selected answer until I got the following error Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. for several assemblies

    using

    [System.Reflection.Assembly]::ReflectionOnlyLoadFrom("C:\full\path\to\YourDllName.dll").GetName().Version
    

    should work in those cases (probably all cases)

提交回复
热议问题