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>
精彩评论