TeamBuild Tidbits – Test pass but results can’t be published

Problem:  Your TeamBuild compiles successfully and the tests are run.  All tests pass but the build still fails.  This usually happens the first time you turn on tests in your build.  You check the build log and see:

Waiting to publish…
  Publishing results of test run 
  
xxx@yyy 2007-01-05 10:19:41_
    Any CPU_Release to 
    http://[YourTFSServer]:8080/
       Build/v1.0/PublishTestResultsBuildService.asmx…
  PublishRun: Access to the path
    ‘\[server][dropshare][TeamProject]
        [Flavor][BuildName]TestResults
        [some GUID][some filename].trx’ is denied.
        MSBUILD : warning : PublishRun: Access to the path

MSBUILD : warning : PublishRun: Access to the path
      \[server][dropshare][TeamProject]
        [Flavor][BuildName]TestResults
        [some GUID][some filename].trx’ is denied.
The previous error was converted to a warning because 
  the task was called with ContinueOnError=true.
Build continuing because “ContinueOnError” on the
  task “TestToolsTask” is set to “true”.

Issue: The publication service is attempting to create a folder (named with a GUID) under the TestResults folder and set permissions on that folder without the proper permissions to do so.

Solution: Make sure that the account that runs your Application Tier web services has Full Control permissions to the DropShare folder.