-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSCode Debugger Environment Variable Case Sensitivity Causes DLL Loading Issues #241570
Comments
What is the type of your launch config? |
I have the same issue. The trick is to get VSCode to launch with both a "Path" and "PATH" environment variable. It can be reproduced with the following recipe:
This will show two path environment variables. One "Path" and one "PATH". VSCode Version: 1.97.2 (system setup) |
To verify this process is quite simple with the following configuration in launch.json: json 复制 However, it appears that in typical scenarios, using system APIs to set the PATH environment variable or using batch commands like set path does not differentiate between uppercase and lowercase. This case sensitivity seems to occur only in the configuration of Visual Studio Code. |
Thanks, please file this on the repo for the C++ debug extension |
Type: Bug
Description:
On Windows, VSCode's launch.json configuration file treats environment variables Path and PATH as case-sensitive. However, Windows itself does not distinguish between Path and PATH, and only recognizes Path for DLL loading. If PATH is incorrectly used in launch.json, the program may fail to load DLL files during debugging.
Steps to Reproduce:
Create a simple program that requires a DLL file to be loaded.
In launch.json, incorrectly configure the environment variable as PATH instead of Path (e.g., "name": "PATH", "value": "C:\path\to\dlls").
When debugging, the program will fail to load the DLL, showing an error.
Changing PATH to Path in launch.json resolves the issue and allows the DLL to be loaded.
Actual Behavior:
Using PATH does not affect DLL loading in Windows, causing DLLs to not be found during debugging.
Expected Behavior:
VSCode should handle environment variables uniformly and not differentiate between Path and PATH, ensuring that DLLs can be loaded successfully during debugging.
Suggested Solution:
Fix the issue in VSCode where environment variables are treated case-sensitively in launch.json. Ensure that both Path and PATH are treated identically to avoid DLL loading issues.
VS Code version: Code 1.97.2 (e54c774, 2025-02-12T23:20:35.343Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Extensions (18)
(1 theme extensions excluded)
A/B Experiments
The text was updated successfully, but these errors were encountered: