CustomizableOutDir=true breaks MSTest.exe during Team Build
When using CustomizableOutDir, I'm having problems with TFS Team Build firing off MSTest.exe properly.
TFSBuild.rsp
/verbosity:diagnostic
/p:CustomizableOutDir=true
TFSBuild.proj (solutions to build snippet)
    <!-- code -->
    <SolutionToBuild Include="$(BuildProjectFolderPath)/../../foo.csproj">
      <Properties>OutputPath=$(BinariesRoot)WindowsServicesfoo</Properties>
    </SolutionToBuild>
    <!-- tests -->
    <SolutionToBuild Include="$(BuildProjectFolderPath)/../../test/test.sln">
      <Targets>t1;t2</Targets>
      <Properties>OutputPath=$(BinariesRoot)TestHarness</Properties>
    </SolutionToBuild>
 With both <Properties>OutputPath=$(BinariesRoot)TestHarness</Properties> and <Properties></Properties> , I get the following error at the end of the build:  
 "C:buildBuildTypeTFSBuild.proj" (TestConfiguration target) (1:12) -> (CoreTestConfiguration target) ->  
 MSBUILD : warning MSB6003: The specified task executable "MSTest.exe" could not be run.  The directory name is invalid  
After finding this article, I and then added the following:
  <Target Name="AfterCompile">
    <ItemGroup>
      <SolutionOutputs Condition="'%(CompilationOutputs.Solution)' == '$(Solution)'" Include="%(RootDir)%(Directory)***.*" />
      <ServiceOutputs Include="$(BinariesRoot)WindowsServices***.*" />
      <TestHarnessOutputs Include="$(BinariesRoot)TestHarness*.*" />
    </ItemGroup>
    <Copy SourceFiles="@(SolutionOutputs)" DestinationFolder="$(TeamBuildOutDir)" />
    <Copy SourceFiles="@(ServiceOutputs)" DestinationFolder="$(TeamBuildOutDir)"  />
    <Copy SourceFiles="@(TestHarnessOutputs)" DestinationFolder="$(TeamBuildOutDir)"  />
  </Target>
Which gave this:
 (AfterCompile target) ->  
 C:buildBuildTypeTFSBuild.proj(289,5): error MSB3023: No destination specified for Copy.  Please supply either "DestinationFiles" or "DestinationDirectory".  
 DestinationDirectory is not part of the schema http://schemas.microsoft.com/developer/msbuild/2003 , but I figured I would try it anyway.  So I changed all the DestinationFolder on the copy tasks to DestinationDirectory and as expected I got this:  
 (AfterCompile target) ->  
 C:buildBuildTypeTFSBuild.proj(288,44): error MSB4064: The "DestinationDirectory" parameter is not supported by the "Copy" task.  Verify the parameter exists on the task, and it is a settable public instance property.  
 C:buildBuildTypeTFSBuild.proj(288,5): error MSB4063: The "Copy" task could not be initialized with its input parameters.  
Anybody out there have CustomizableOutDir and MSTest working together in harmony with their TFS Team Build?
EDIT:
I found this discussion and applied this change:
<Target Name="BeforeTest">
  <!-- The tests won't run if the binaries directory does not exist -->
  <MakeDir
    Directories="$(BinariesRoot)%(ConfigurationToBuild.FlavorToBuild)"
    Condition="!Exists('$(BinariesRoot)%(ConfigurationToBuild.FlavorToBuild)')" />
</Target>
Which resulted in this:
 "C:buildBuildTypeTFSBuild.proj" (RunTest target) (1:11) -> "C:buildBuildTypeTFSBuild.proj" (TestConfiguration target) (1:12) -> (CoreTestConfiguration target) ->  
 MSBUILD : warning MSB6006: "MSTest.exe" exited with code 1.  
This made tfs/mstest/msbuild happy.
<Target Name="BeforeTest">
  <!-- The tests won't run if the binaries directory does not exist -->
  <MakeDir
    Directories="$(BinariesRoot)%(ConfigurationToBuild.FlavorToBuild)"
    Condition="!Exists('$(BinariesRoot)%(ConfigurationToBuild.FlavorToBuild)')" />
</Target>
Not getting any test results was a different problem with the deployment and test box configuration.
链接地址: http://www.djcxy.com/p/43486.html上一篇: 在Rails应用程序中记录线程
