我需要读取DLL的AssemblyFileVersion而不仅仅是Version.我试过了:
<Target Name="RetrieveIdentities"> <GetAssemblyIdentity AssemblyFiles="some.dll"> <Output TaskParameter="Assemblies" ItemName="MyAssemblyIdentities"/> </GetAssemblyIdentity> <Message Text="%(MyAssemblyIdentities.FileVersion)" /> </Target>
脚本运行但不输出任何内容.如果我将FileVersion更改为Version,它会正确输出AssemblyVersion.如何使用我的脚本获得AssemblyFileVersion?
MSBuild Extension Pack拥有
MaxAssemblyFileVersion可能有用的属性.
更新:
从documentation看起来,GetAssemblyIdentity任务看起来不像FileVersion.
The items output by the Assemblies parameter contain item Metadata
entries named Version,PublicKeyToken,and Culture.
另外,请参阅以下StackOverflow帖子.