cppbuild task uses stale cached VS Developer Environment after upgrading to a newer Visual Studio installation
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp, typescript, vscode
- Lĩnh vực
- build-system, devtools
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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:
- Install VS Build tools 2022
- Building any C++ project using cl.exe inside VSCode
- Remove VS Build tools 2022, then update to 2026
- 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.
- Ngôn ngữ chính
- TypeScript
- Star
- 6.2k
- Fork
- 1.7k
- Merge trung bình
- 18 giờ 37 phút
- Pull request đã merge (30 ngày)
- 50
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/vscode-cpptools
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
microsoft/vscode-cpptools#14801 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Browse database relocated to `/var/tmp` despite settings; quickly consumes all available space under `/`Có thể đã có người làm @Colengms đã nhận 2 ngày trước. Đang mởLanguage Service more info needed
microsoft/vscode-cpptools#14795 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
deduction guides do not work through alias templatesCó thể đã có người làm @Colengms đã nhận 2 ngày trước. Đang mởbug Language Service parser
microsoft/vscode-cpptools#14794 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Extension Signature Verification Failed: C/C++ Extension PackCó thể đã có người làm @sean-mcmanus đã nhận 5 ngày trước. Đang mởmore info needed
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoft/vscode-cpptools#14787 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared librariesCó thể đã có người làm @Colengms đã nhận 10 ngày trước. Đang mởbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/vscode-cpptools
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/vscode-livepreview#876 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
JustJarethB/invoicer#54 ·
-
ICP 1.2.0 shows a scheduled task's interval in milliseconds under the label "Interval (In seconds)"Đang mởNeeds Triage Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
wso2/product-integrator#2585 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Telemundo West sdĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MTES-MCT/monitor-field#119 ·
Maintainer thường phản hồi trong vòng 1 ngày