Skip to content

ArijitKD/vscode-msvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vscode-msvc

A program that launches Visual Studio Code with MSVC Toolchain support.

Pre-requisites

  • 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 command code from the terminal just in case);
  • An environment variable VSBUILDTOOLSDIR must 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).

Installation

  • Make sure pre-requisites are fulfilled.
  • Download the latest version of vscode-msvc from the Releases section. There are two files, vscode-msvc-x86.exe and vscode-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.

Setting the VSBUILDTOOLSDIR environment variable

  • 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:
    **********************************************************************
    ** Visual Studio 2026 Developer Command Prompt v18.3.0
    ** Copyright (c) 2025 Microsoft Corporation
    **********************************************************************
    
    C:\Program Files\Microsoft Visual Studio\18\BuildTools>|
    
    In this case, the path C:\Program Files\Microsoft Visual Studio\18\BuildTools should 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:
    cl
    
    You should see either:
    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... ]
    
    or:
    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... ]
    
    depending on the architecture of MSVC Toolchain loaded.

Known issues

  • 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.

License

vscode-msvc is available under the MIT License.

About

A program that launches Visual Studio Code with MSVC Toolchain support.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages