Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

cppbuild task uses stale cached VS Developer Environment after upgrading to a newer Visual Studio installation

Offen
#14,800 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
52/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
cpp, typescript, vscode

Rechercherichtung

The issue identifies .vscode/tasks.json, vcvarsall.bat, and the “Set VS Developer Environment” command (#4742) as relevant entry points. Trace how cppbuild obtains and caches the developer environment after a Visual Studio replacement, then reproduce the upgrade sequence and verify the generated task uses the new installation without a manual environment reset.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Environment
  • OS and Version: Windows 11 24H2
  • VS Code Version: 1.126.0 (User setup)
  • C/C++ Extension Version: 1.34.4
  • If using SSH remote, specify OS of remote machine: Running locally
Bug Summary and Steps to Reproduce

Bug Summary:
After upgrading Visual Studio Build tools from 2022 to 2026, IntellSense correctly reports the latest path, while the 'cppbuild' task in .vscode/tasks.json still uses the cached environment, resulting C1083 error: include path cannot be found.

Initially, I speculated that it's a issue in Build tools, but I tried repairing and reinstalling, none of them worked. The enviroment variables in Code.exe seems consistent with vcvarsall.bat, and directly building in command line worked as well.

This suggests the problem must be within the VSCode itself. Eventually I tried "Set VS Developer Environment" (#4742, added in 1.29.0), which fixed the issue.

Seems it caches the detected developer environment somewhere, and this cache is not invalidated/refreshed when the underlying VS installation changes.

Steps to reproduce:

  1. Install VS Build tools 2022
  2. Building any C++ project using cl.exe inside VSCode
  3. Remove VS Build tools 2022, then update to 2026
  4. See error

Expected behavior:
VSCode starting from vcvarsall.bat should build the project successfully.

Configuration and Logs
{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.26100.0",
            "compilerPath": "cl.exe",
            "cStandard": "c17",
            "intelliSenseMode": "windows-msvc-x64"
        }
    ],
    "version": 4
}

Current database path: %userprofile%\AppData\Local\Microsoft\vscode-cpptools\5a1572067cb7701b835e17d775b99ce1\.BROWSE.VC.DB
Translation Unit Mappings:
[ <PROJECT_DIR>\<file>.cpp - source TU]:
Translation Unit Configurations:
[ <PROJECT_DIR>\<file>.cpp ]
    Process ID: 23980
    Memory Usage: 194 MB
    Compiler Path: C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\bin\Hostx64\x64\cl.exe
    Language: C++
    Include Paths:
        include: C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\include
        include: C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Auxiliary\VS\include
        include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
        include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um
        include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared
        include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\winrt
        include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\winrt
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt
        include (recursive): <PROJECT_DIR>
    Defines:
        _DEBUG
        UNICODE
        _UNICODE
    Standard Version: ms_c++20
    IntelliSense Mode: windows-msvc-x64
    Other Flags:
        --using_directory
        C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\lib\x64
        --using_directory
        C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\lib\x86\store\references
        --using_directory
        C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0
        --using_directory
        C:\Program Files (x86)\Windows Kits\10\References\10.0.26100.0
        --using_directory
        C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Total Memory Usage: 194 MB
Other Extensions

No response

Additional context
Related issues
  • #14352 and #14089 report a similar-sounding "developer environment" failure, but those describe the feature never successfully applying in the first place.
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
18 Std. 16 Min.
Gemergte PRs (30 T.)
51

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/vscode-cpptools

Alle Issues in microsoft/vscode-cpptools

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.