开发者

Read assembly version number in post-build event?

开发者 https://www.devze.com 2023-01-03 02:05 出处:网络
When I change the assembly开发者_Python百科 information to lets say 1.0.0.1 i thought that i could read the version with $(Version) but it seems that it does not change?You could use the GetAssemblyId

When I change the assembly开发者_Python百科 information to lets say 1.0.0.1 i thought that i could read the version with $(Version) but it seems that it does not change?


You could use the GetAssemblyIdentity task to retrieve the version :

<Target Name="AfterBuild">
  <GetAssemblyIdentity AssemblyFiles="$(OutputPath)\$(AssemblyName).$(OutputType)">
    <Output TaskParameter="Assemblies" ItemName="AssemblyIdentities"/>
  </GetAssemblyIdentity>

  <PropertyGroup>
    <CssOutputFile Condition="'$(CssOutputFile)'==''">
      ..\Styles\master-%(AssemblyIdentities.Version).css
    </CssOutputFile>
  </PropertyGroup>
  <Message Text="CssOutputFile : $(CssOutputFile)"/>
</Target>
0

精彩评论

暂无评论...
验证码 换一张
取 消