tags:

views:

58

answers:

1

When I change the assembly 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?

A: 

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>
madgnome
Ok I see, how can I use the value inside a propertygroup?Like this CssOutputFile Condition=" '$(CssOutputFile)'=='' ">..\Styles\master-VERSION-HERE.css</CssOutputFile>
Marcus
I've updated the code for this usage.
madgnome