I accomplished this using the testmetadata
argument and pointing it to my .vsmdi file.
As explained here.
E.g.:
mstest /testmetadata:mySolution.vsmdi
However note that testmetadata
can be more fragile (e.g. empty test lists combined with the Ignore attribute cause “Specified cast is not valid”).
Creating a batch with all DLLs containing test classes could be more reliable alternative.