views:

529

answers:

1

I have an after build event in my main TFSBuild.proj file that uses the MSBuild task to call a deployment task after a successful build. It looks like this:

<ItemGroup>
    <DeploymentTargets Include="..\Sources\Build\SkunkWorks.Build.Deployment.targets">
      <Properties></Properties>
    </DeploymentTargets>
 </ItemGroup>
 <Target Name="AfterBuild">
    <Message Text="Executing Deployment"/>
    <MSBuild Projects="@(DeploymentTargets)" 
       Properties="PickUpLocation='@(DropLocation)'" 
       ContinueOnError="false"/>
 </Target>

This works fine and the deployment script is called as you would expect. The problem is that any errors or messages produced by executing the MSBuild are not written to the BuildLog.txt or ErrorsAndWarnings.txt files that are placed in the drop location after a successful build.

Is there an easy way to capture this information?

+1  A: 

Could you get around it by calling the targets directly instead of via MSBuild?

<Import Projects="..\Sources\Build\SkunkWorks.Build.Deployment.targets/>

<Target Name=""/>
  <CallTarget Targets="DeploymentTarget1"/>
</Target>

Alternatively, try taking a look at the Microsoft.TeamFoundation.Build.targets file on your build machine. They use a lot of MSBuild calls in there and I see that they pass in a property for LogLocation. But I don't know if that's a global Team Build thing or just internal to that file.

Ross Johnston