Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GetAssemblyIdentity Version always 1.0.0.0

Tags:

msbuild

The Version is 1.0.0.0 even though both the file version and product version are defined in the DLL and display correctly when I view its properties in Windows 7. Any suggestions?

  <Target Name="TestingAssemblyIdentity">
    <GetAssemblyIdentity AssemblyFiles="MyCSharp.dll">
      <Output TaskParameter="Assemblies" ItemName="assemblyInfo"/>
    </GetAssemblyIdentity>
    <Message Text="GetAssemblyIdentity Version is %(assemblyInfo.Version)" />
  </Target>
like image 769
user1967469 Avatar asked Mar 22 '26 11:03

user1967469


1 Answers

The GetAssemlyIdentity task returns the assembly version (AssemblyVersionAttribute), not the file or product version. The later are not part of the assembly's identity.

Note that assembly version and assembly file/product version serve different purposes.

See here for a possible way to read the file version from within msbuild.

like image 124
Christian.K Avatar answered Mar 24 '26 22:03

Christian.K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!