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
Well, the message you get when running mstest.exe /? is actually very misleading. It tells you that Team Explorer is required to publish your test results, but unfortunately installing Team Explorer doesn't change anything. As Martin stated, MsTest does a license check to ensure that appropriate edition of Visual Studio is installed and thus '/publish' and other switches are not available.
And by 'appropriate' edition MsTest means Premium or Ultimate, not sure about other editions.
Microsoft says you should install Visual Studio on your server to have a fully featured CI and this is the only official and supported solution, but if you really don't like this concept (and I don't), you can make MsTest think that Visual Studio is installed on your server.
It is enough to export some registry keys from your development machine to your CI server and voila! - MsTest does publish your test results to TFS.
The registry keys are at
HKLM\SOFTWARE\Microsoft\VisualStudio\12.0\Licenses
or at
HKLM\Software\Wow6432Node\Microsoft\VisualStudio\12.0\Licenses
depending on your system.
You can find more details of this solution here: http://blog.foxxtrot.net/2010/02/hacking-mstest-out-of-visual-studio.html