Similarly to How to use MsTest in Continuous Integration without VS?, I want to run mstest.exe on a TeamBuild server.
My context is Trapping Error Status in MSBuild
The /publish option of MSTest.exe does a license check to ensure that a "Team" version of Visual Studio is installed (i.e. the Developer or Test edition) before it does the publish part of the code.
This restriction appears to have been introduced to allow the basic unit testing capabilities in standard versions of Visual Studio but requires you to have one of the more expensive Team editions of Visual Studio to enable the "Team" related features in testing - such as to publish your test results to TFS.
In total there are 3 missing features if you do not have a Team edition of Visual Studio with Team Epxlorer installed.
If you have the Development Edition installed then you get publish and codecoverage but not the remote agent agent capabilities (i.e. for doing Load lesting).
The Test Edition and Visual Studio Team Suite have everything.
If you would like to see an example of a custom MSBuild task that uses MSTest.exe to publish unit test data from a build server (in this example JUnit test data), then take a look at the Teamprise Build Extensions that I wrote. The source code for these is available under the permissive MS-PL open source license.