Installing VisualGDB Manually

Normally, VisualGDB can be installed automatically by running the its MSI file:

However, it may not work in some exotic configurations, e.g.:

  • Using MSBuild only, without Visual Studio
  • Trying to use multiple VisualGDB versions on the same machine
  • Not being able to use Windows Installer

This document explains how to install VisualGDB manually by copying the necessary files from an existing installation.

Non-MSBuild Projects

If your projects are not based on MSBuild, you can simply copy the C:\Program Files (x86)\Sysprogs\VisualGDB directory to an arbitrary location on another machine. Then you can use the following command lines to invoke VisualGDB manually:

Command Line Meaning
VisualGDB.exe /build <file.vgdbsettings> Build a specific project. Works for .vgdbsettings, .vgdbcmake or .vgdbproj files.
VisualGDB.exe /launch <file.vgdbsettings> Run a program without debugging.
VisualGDB.exe /teamsync Synchronize Team Settings
VisualGDB.exe /teamsync:\\server\share Set the shared team settings folder and synchronize Team Settings
VisualGDB.exe /pkgmgr Show the VisualGDB Package Manager window
VisualGDB.exe /about Show the About VisualGDB window
VisualGDB.exe /runtests <file.vgdbtestcontainer> Run tests from a given project or a test container

MSBuild-based Projects

Building MSBuild-based projects without using the VisualGDB installer requires copying the VisualGDB platform definition into the MSBuild platform directory. Below is the location of the MSBuild platform directory for different Visual Studio versions:

Visual Studio Year Internal Version MSBuild Platform Directory
2010 10.0 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms
2012 11.0 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms
2013 12.0 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms
2015 14.0 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms
2017 15.0 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Platforms
2019 16.0 C:\Program Files (x86)\Microsoft Visual Studio\2019\<Edition>\MSBuild\Microsoft\VC\v160\Platforms

The VisualGDB platform files can be copied from the <Platforms>\VisualGDB directory on a machine with a regular VisualGDB installation.

Note that the VisualGDB platform files reference the $(VISUALGDB_DIR) environment variable:

Make sure you set it in your System Settings, or hardcode the VisualGDB path inside the copied platform files.

If you would like to use multiple VisualGDB installations on the same machine, you can add conditions to the <Import> elements inside the platform definition, and pick a specific VisualGDB location based on some variables specified in the project file.

Visual Studio Extension Files

If you are manually installing VisualGDB into a specific Visual Studio instance, you would also need to copy the VisualGDB extension definition. This can be done as shown below:

  1. Copy the <Visual Studio Directory>\Common7\IDE\Extensions\Sysprogs\VisualGDB directory from an existing installation
  2. Replace the VisualGDB path in the VisualGDB.pkgdef and extension.vsixmanifest files (search for C:\ to find all instances of it)
  3. Start Visual Studio, open the Extension Manager and enable the VisualGDB extension there

Note that the .pkgdef and .vsixmanifest files should include the full paths to the VisualGDB directory and cannot use any environment variables.