I want to use mstest.exe to run my unit test on build server, but I don't want to install Visual Studio on the build server. Can I just install MSTest without Visual Studio?
It is possible to run mstest.exe without visual studio.
Download one of the Agents for Visual Studio ISO's below and install the Test Agent on the server:
winget install --id=Microsoft.VisualStudio.2022.BuildTools -e
. Open the visual studio installer and select core testing tools from the individual packages to have the vstest.console.exe
(successor of mstest.exe).This installs everything needed for running mstest.exe from the command line and is much lighter weight than visual studio. ~500mb download and around ~300mb to install just the test agent if I remember correctly.