How to install vstest.console.exe offline

13.7k Views Asked by At

I am supposed to do an offline installation of vstest.console.exe in the folder path as follows: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow

I have tried using offline packages such as vs_testagent.exe and vs_testcontroller.exe according to the following link: https://learn.microsoft.com/en-us/visualstudio/install/create-a-network-installation-of-visual-studio. However, these packages do not contain vstest.console.exe.

I am also unable to do a full installation of VS2017 due to space issues. Do anyone have any suggestions? Thanks.

4

There are 4 best solutions below

0
On

Download the Visual Studio Build Tools installer from https://my.visualstudio.com/Downloads?q=build%20tools%20for%20visual%20studio

Run the installer, click the tab Individual components and select Testing tool core features - Build Tools

enter image description here

After installation the vstest.console.exe is located in folder

C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow

0
On

Download the nuget package: Microsoft.TestPlatform, rename it a zip file. Open the zip file, you will find all you need from this folder: .\tools\net451\Common7\IDE\Extensions\TestPlatform, including vstest.console.exe, testhost.**.exe, QTAgent.exe, datacollector.exe.

If you added the nuget package to project, it just downloads the package to packages folder and won't complie to bin, so you have to add a Post-Build event to copy files to bin folder from the packages folder.

2
On

You are looking for "Build Tools for Visual Studio" (Microsoft login required). It will give you an installer "vs_BuildTools.exe", which will install by default the build tools in:

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools

(by default)

Two versions of vstest console were installed when I ran it:

  1. ...\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe
  2. ...\Common7\IDE\Extensions\TestPlatform\vstest.console.exe

I do not know why, nor how they are different. I use the first one.

0
On

I used the chocolatey package visualstudio2019testagent to install VS 2019 Test Agent.

Not sure if this would help someone in the future.