A program that launches Visual Studio Code with MSVC Toolchain support.
- Visual Studio Code installed;
- Visual Studio Build Tools installed along with MSVC and Windows SDK;
- VS Code must be added to
PATH(This is done automatically by default when VS Code is installed, but check if you can run the commandcodefrom the terminal just in case); - An environment variable
VSBUILDTOOLSDIRmust be set, containing the path of Visual Studio Build Tools directory (usually:C:\Program Files (x86)\Microsoft Visual Studio\<visual-studio-edition-year>\BuildTools, may be different for your system).
- Make sure pre-requisites are fulfilled.
- Download the latest version of
vscode-msvcfrom the Releases section. There are two files,vscode-msvc-x86.exeandvscode-msvc-x64.exe. They are for the 32-bit and 64-bit MSVC toolchains respectively, and do not denote the program architecture. You'd want to download both for convenience. - Copy them to your Desktop/Workspace folder and use them as per your requirements.
- Open the Developer Command Prompt from the Start Menu.
- In the prompt that appears, copy the path. For example, you might have a prompt that looks like:
In this case, the path
********************************************************************** ** Visual Studio 2026 Developer Command Prompt v18.3.0 ** Copyright (c) 2025 Microsoft Corporation ********************************************************************** C:\Program Files\Microsoft Visual Studio\18\BuildTools>|C:\Program Files\Microsoft Visual Studio\18\BuildToolsshould be copied. - Open Settings (press WIN + I to do that quickly).
- In the Search bar, start typing "environment variables" and choose
Edit the system environment variables. - In the dialog box that appears, click on the
Environment Variables...button at the bottom right. - In the System variables section, click on
New.... - Set the Variable name as
VSBUILDTOOLSDIR. - Set the Variable value as the path copied earlier (in the above example,
C:\Program Files\Microsoft Visual Studio\18\BuildTools). - Click on OK in all the opened dialog boxes.
- You can now launch VS Code with either of the executables (x86 or x64) downloaded earlier.
- To verify if the MSVC toolchain is available, launch a terminal session in VS Code (either PowerShell or Command Prompt). You might use Ctrl+Shift+` to do so.
- Run the command:
You should see either:
clor:Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35724 for x64 Copyright (C) Microsoft Corporation. All rights reserved. usage: cl [ option... ] filename... [ /link linkoption... ]depending on the architecture of MSVC Toolchain loaded.Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35724 for x86 Copyright (C) Microsoft Corporation. All rights reserved. usage: cl [ option... ] filename... [ /link linkoption... ]
- For switching between x64 and x86 MSVC Toochain the current instance of VS Code needs to be closed, otherwise the new instance with not launch with the desired toolchain support. This is not a bug, but an issue with VS Code itself where the environment variables of new instances are not properly reset.
vscode-msvc is available under the MIT License.