Monday, November 12, 2012

XML Transformation on MSBuild TFS 2010

Many thanks to Blog ----

<Target Name="BeforeBuild">
<!--<Target Name="AfterBuild">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />
-->    <Target Name="AfterBuild" Condition="$(IsAutoBuild)=='True'">
     <DeleteAfterBuild Include="$(WebProjectOutputDir)\Web.*.config" />
    <TransformXml Source="Web.config" Transform="$(ProjectConfigTransformFileName)" Destination="$(WebProjectOutputDir)\Web.config"/>
   <Delete Files="@(DeleteAfterBuild)" />

Assuming you have saved and checked in your project file and are in the process of creating a build definition, on the Process step of your build definition you will find under the Advanced heading a field labeled “MSBuild Arguments”. Enter the value /p:IsAutoBuild=”True”.

Simple GOTCHA, be sure to check in the PROJECT File back to Source Control before testing (DUH!)
Post a Comment