TF270015: ‘MSTest.exe’ returned an unexpected exit code. Expected ‘0’; actual ‘1’

There is a problem in Team Build 2010 when executing Unit Test cases from a Visual Studio 2008 solution.  The test cases run, but when MSTest tries to publish the results to TFS, then you get this error: TF270015: ‘MSTest.exe’ returned an unexpected exit code. Expected ‘0’; actual ‘1’.  Not very informational, and pretty cryptic.  Digging around a little, I found this on MS Connect: http://connect.microsoft.com/VisualStudio/feedback/details/576322/tf270015-mstest-exe-returned-an-unexpected-exit-code-expected-0-actual-1

They have a hotfix for this, released last month: http://code.msdn.microsoft.com/KB983504/Release/ProjectReleases.aspx?ReleaseId=4749

They don’t specify where the hot-fix should run, we ran it on the build machine and everything works fine now. 

Another solution to this problem would’ve been to find the MSBuild task on the build workflow and point it to the 3.5 version rather than the 4.0 that it uses by default on TFS 2010, but what we implemented seemed like a more long-term solution.

About esteban

Esteban is the Founder and Chief Technologist at Nebbia Technology, an ALM consulting and Azure-powered technology company. He is a software developer with a passion for ALM, TFS, Azure, and software development best practices. Esteban is a Microsoft Visual Studio ALM MVP and ALM Ranger, Pluralsight author, and the president of ONETUG (Orlando .NET User Group).

2 thoughts on “I’m on Radio TFS # 103!

  1. Renato Bento

    Thank you,
    this really helped me out!
    I was on a hard path trying to parse this parameters as a XmlDoc.

  2. Jorge Sanchez

    Hey I being using your code to accomplish the same thing but I never work with TFS before, I think I got it to the part that I could pass the ProjectFilePath and NewAssemblyName, but I not sure how to pass the Workspace InArgument do you have an example of how do I specify this on MsBuild?

    BTW i also change

    var workspace = context.GetValue(this.Workspace);
    to
    var workspace = (Workspace)context.GetValue(Workspace);

    is this correct?

    Thank you very much


Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? *