开发者

Read assembly version number in post-build event?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜