# Failure when publishing test results to Team Build

**URL:** https://www.finalbuilder.com/forums/t/failure-when-publishing-test-results-to-team-build/1334
**Category:** Discussion
**Created:** [September 30, 2009, 10:15am UTC](https://www.finalbuilder.com/forums/t/failure-when-publishing-test-results-to-team-build/1334 "2009-09-30T10:15:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [September 30, 2009, 10:15am UTC](https://www.finalbuilder.com/forums/t/failure-when-publishing-test-results-to-team-build/1334/1 "2009-09-30T10:15:46Z")

</div>

Hi all

I get this error after running some tests in FB:

**(CoreCompile target) -\>   
&nbsp; c:\builds\Jynnji\Interops\_Full\BuildType\TFSBuild.proj(202,5): error MSB4018: The "FBCmd" task failed unexpectedly.  
c:\builds\Jynnji\Interops\_Full\BuildType\TFSBuild.proj(202,5): error MSB4018: FinalBuilder.TeamBuildProxy.TeamProxyException: Failed to publish test results from FinalBuilder : MSTest publish failed with exit code 1 : String was not recognized as a valid DateTime. ---\> FinalBuilder.TestResultWrapper.PublishException: MSTest publish failed with exit code 1 : String was not recognized as a valid DateTime.  
c:\builds\Jynnji\Interops\_Full\BuildType\TFSBuild.proj(202,5): error MSB4018:&nbsp;&nbsp;&nbsp; at FinalBuilder.TestResultWrapper.DummyTestRun.Publish(String tfsServer, String buildName, String teamProject, Int32 visualStudioVersion)  
c:\builds\Jynnji\Interops\_Full\BuildType\TFSBuild.proj(202,5): error MSB4018:&nbsp;&nbsp;&nbsp; at FinalBuilder.TeamBuildProxy.MetricSummary.PublishTestResults(String tfsServer, String buildId, String teamProject, Int32 visualStudioVer)  
c:\builds\Jynnji\Interops\_Full\BuildType\TFSBuild.proj(202,5): error MSB4018:&nbsp;&nbsp;&nbsp; --- End of inner exception stack trace ---  
c:\builds\Jynnji\Interops\_Full\BuildType\TFSBuild.proj(202,5): error MSB4018:&nbsp;&nbsp;&nbsp; at FinalBuilder.TeamBuildProxy.MetricSummary.PublishTestResults(String tfsServer, String buildId, String teamProject, Int32 visualStudioVer)  
c:\builds\Jynnji\Interops\_Full\BuildType\TFSBuild.proj(202,5): error MSB4018:&nbsp;&nbsp;&nbsp; at FinalBuilder.TeamBuildProxy.TeamBuildProxy2008.SendMetrics(MetricSummary metrics)  
c:\builds\Jynnji\Interops\_Full\BuildType\TFSBuild.proj(202,5): error MSB4018:&nbsp;&nbsp;&nbsp; at FinalBuilder.FBCmd.TeamBuildAfterProject(String projFileName, Boolean success)  
c:\builds\Jynnji\Interops\_Full\BuildType\TFSBuild.proj(202,5): error MSB4018:&nbsp;&nbsp;&nbsp; at FinalBuilder.FBCmd.Execute()  
c:\builds\Jynnji\Interops\_Full\BuildType\TFSBuild.proj(202,5): error MSB4018:&nbsp;&nbsp;&nbsp; at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)**  
  
**&nbsp;&nbsp;&nbsp; 3 Warning(s)  
&nbsp;&nbsp;&nbsp; 1 Error(s)**

Which results in a build error, the strange thing is that the results DO&nbsp;get published.

Any ideas where to start?

Kev

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [October 1, 2009, 3:25am UTC](https://www.finalbuilder.com/forums/t/failure-when-publishing-test-results-to-team-build/1334/2 "2009-10-01T03:25:11Z")

</div>

Hi Kevin   
  
 A strange one indeed (the fact that mstest reports an error and still actually publishes the tests).   
  
 The way this works is we generate an xml file in the format required by mstest and then execute mstest. To figure out what is happening we really need to see the xml file. Please install this build :   
  
 [https://www.finalbuilder.com/downloads/finalbuilder/630/FB630\_1745.exe](https://www.finalbuilder.com/downloads/finalbuilder/630/FB630_1745.exe)   
  
 What this build does differently is it does not delete the xml file when mstest reports a non zero return code, and the error exception will include the name of the xml file. Please send the file to support at finalbuilder dot com so we can see what it is failing on.
