Skip to content

Instantly share code, notes, and snippets.

@hotgazpacho
Created February 16, 2011 13:04
Show Gist options
  • Select an option

  • Save hotgazpacho/829333 to your computer and use it in GitHub Desktop.

Select an option

Save hotgazpacho/829333 to your computer and use it in GitHub Desktop.
Using the XmlUpdate task from MSBuild Community Tasks
<Import Project=".\MSBuild.Community.Tasks.Targets"/>
<PropertyGroup>
<Company>My Company</Company>
<Product>My Product</Product>
<Version>1.0.0.0</Version>
</PropertyGroup>
<Target Name="UpdateBuildInfo">
<XmlUpdate XmlFileName=".\_BuildInfo.xml" XPath="//buildInfo/projectName" Value="$(Product)" />
<XmlUpdate XmlFileName=".\_BuildInfo.xml" XPath="//buildInfo/companyName" Value="$(Company)" />
<XmlUpdate XmlFileName=".\_BuildInfo.xml" XPath="//buildInfo/version" Value="$(Version)" />
</Target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment