Skip to content

Latest version 1.29.2 fails to see MSVC environment #14084

Closed

Description

@mambo4

Environment

  • OS and version: Windows 10
  • VS Code: 1.106.3 (user setup)
  • C/C++ extension: 1.29.2
  • OS and version of remote machine (if applicable):
  • GDB / LLDB version:

Bug Summary and Steps to Reproduce

Bug Summary:
C/C++ 1.29.2 never successfully detects the MSVC environment, blocking all compiles and debugs.

Steps to reproduce:

  1. Launch VS Code from MSVC command prompt, with C/C++ 1.29.2 extension
  2. Try the "Debug and Run" function that worked in 1.28.3 on 12/3/2025
  3. Notice the "cl.exe build and debug active file requires the Visual Studio developer environment." error pop up
  4. Click "apply Visual Studio Developer environment"
  5. Notice that this does not fix the issue nor remove the error pop up
  6. rollback C/C++ extension to 1.28.3
  7. Notice that this version is not broken

Debugger Configurations

Irrelevant because C/C++ 1.29.2 never successfully detects the MSVC environment, blocking all compiles and debugs.

Debugger Logs

Irrelevant because C/C++ 1.29.2 never successfully detects the MSVC environment, blocking all compiles and debugs.

Other Extensions

Irrelevant because C/C++ 1.29.2 never successfully detects the MSVC environment, blocking all compiles and debugs.

Additional Information

No response

Activity

  1. sean-mcmanus commented on Dec 4, 2025

    @sean-mcmanus
    Contributor

    Logan Bender (@mambo4) I don't repro the issue -- which MSVC developer command prompt are you using exactly (i.e. which version of VS, which target architecture)? Also, what happens if you don't start VS Code from a developer command prompt (and instead rely on the "apply Visual Studio Developer environment")?

  2. mambo4 commented on Dec 5, 2025

    @mambo4
    Author
  3. bobbrow commented on Dec 5, 2025

    @bobbrow
    Contributor

    I believe it is checking for NETFXSDKDir which you don't have. As a workaround, try defining this variable to something (hopefully it doesn't matter what). We should remove this variable from the environment test.

  4. added
    regressionA bug that didn't exist in a previous release
    and removed
    more info neededThe issue report is not actionable in its current state
    on Dec 5, 2025
  5. moved this from Todo to Done in cpptoolson Dec 5, 2025
  6. added this to the 1.29.3 milestone on Dec 5, 2025
  7. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Dec 5, 2025
  8. mambo4 commented on Dec 6, 2025

    @mambo4
    Author

    I set NETFXSDKDir = C:\temp in windows system environment variables
    it shows up in a the vanilla cmds set result

    but it vanishes when using MSVC Developer command prompt
    even if I try to set it in my .bat before launching Developer command prompt
    Developer command prompt must have a different env

    So the issue persists

    If I

    1. launch Developer command prompt
    2. Launch VS Code from Developer command prompt
    3. set NETFXSDKDir=C:\temp from the terminal inside VS Code
    4. launch VSCode again from the terminal inside VS Code

    only then, in the second VS Code session, does it actually seem to work

  9. Stargazer1209 commented on Dec 8, 2025

    @Stargazer1209

    similar issue here, switching to vscode profile with new version of cpp extension blocks/loses some part of msvc environment variables which breaks compiling and debugging, to be detailed:

    If I

    1. launch Developer command prompt (hostx64-targetx64 on win11)
    2. run "set INCLUDE", I can see all headers, compilers paths correctly
    3. Launch VS Code with a clean profile(with no extensions installed) from Developer command prompt
    4. Open vscode internal terminal and do step 2, envs stay normal
    5. Switch to a vscode profile with cpp extension installed, and run step 2 in a new internal terminal, I can only get part of the INCLUDE (same for LIB) env left, some paths ending in "winrt" is gone, while intellisense is reporting headers like "float.h" in "ucrt" paths could not be found
  10. Stargazer1209 commented on Dec 8, 2025

    @Stargazer1209

    similar issue here, switching to vscode profile with new version of cpp extension blocks/loses some part of msvc environment variables which breaks compiling and debugging, to be detailed:

    If I

    1. launch Developer command prompt (hostx64-targetx64 on win11)
    2. run "set INCLUDE", I can see all headers, compilers paths correctly
    3. Launch VS Code with a clean profile(with no extensions installed) from Developer command prompt
    4. Open vscode internal terminal and do step 2, envs stay normal
    5. Switch to a vscode profile with cpp extension installed, and run step 2 in a new internal terminal, I can only get part of the INCLUDE (same for LIB) env left, some paths ending in "winrt" is gone, while intellisense is reporting headers like "float.h" in "ucrt" paths could not be found

    problem solved by updating and repairing visual studio installation

  11. sean-mcmanus commented on Dec 9, 2025

    @sean-mcmanus
    Contributor

    Logan Bender (@mambo4) A fix is released in https://github.com/microsoft/vscode-cpptools/releases/tag/v1.29.3 . However, you need to run the Clear or Set Developer Environment command again.

  12. locked and limited conversation to collaborators on Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugfixedCheck the Milestone for the release in which the fix is or will be available.quick fixregressionA bug that didn't exist in a previous releasetasks/build/debugAn issue relating to tasks.json (e.g. build issues)

Type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions