I am trying to add a BuildStep to the AfterBuild target in MSBuild and I am using the following
<Target Name="AfterCompile">
<ItemGroup>
<TestAssemblies Include="$(OutDir)\DataStoreUnitTests.dll" />
</ItemGroup>
<BuildStep
Name="Run unit Tests"
TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)"
Message="Running unit tests">
<Output TaskParameter="Id" PropertyName="StepId" />
</BuildStep>
<Gallio
Assemblies="@(TestAssemblies)"
ReportTypes="html"
ReportFileNameFormat="buildreport{0}{1}"
ReportOutputDirectory="." />
<BuildStep
TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)"
Id="$(StepId)"
Message="Yay! All tests succeded!"
Status="Succeeded" />
<OnError ExecuteTargets="MarkBuildStepAsFailed" />
</Target>
<Target Name="MarkBuildStepAsFailed">
<BuildStep
TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)"
Id="$(StepId)"
Message="Tests have failed. See test report in drop folder for details."
Status="Failed" />
</Target>
And when I run it in MSBuild I get the following error:
error MSB4044: The "BuildStep" task was not given a value for the required parameter "BuildUri".
And I cannot see why, does anyone know?