Summary
- Goal: to debug a C++ program I am working on.
- Expected Results: After configuration, debugger runs to breakpoint and shows current state of variables, etc.
- Actual Results: When trying to run the debugger on C++ code in VS Code, I get the error in the title. The pop up happens during the pre-launch build task:
The interruption occurs here:
* Executing task: cd C:\Users\wesle\source\repos\raycast/build && cmake --build . --config Debug
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
cuda_test.vcxproj -> C:\Users\wesle\source\repos\raycast\build\Debug\cuda_test.exe
Code:
I am using the auto-generated debug configuration for the Windows (launch) option, with the only addition being a preLaunchTask:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Debug/cuda_test.exe",
"args": [],
"preLaunchTask": "build",
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"console": "externalTerminal"
}
]
}
and this simple tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "cd ${workspaceFolder}/build && cmake --build . --config Debug"
}
]
}
Question:
How do I fix this?
Things I tried:
I think it might be because, somewhere, a path to
"C:/Program Files/..."is being called without the surrounding quotes, and the space is an issue. However, I have searched for a reference to the Program Files directory in all of the following. Nowhere does a reference exist in these files:- settings.json
- launch.json
- c_cpp_properties.json
- tasks.json
Another thing I tried was to delete the
tasks.jsonfile completely and pre-build with debug configuration from the command line. I thought maybe cmake was being replaced with its full, unquoted path via the path env variable. The error persisted (actually popped up a little faster).I have uninstalled all plugins, except the C++ Tools and CMake Tools extensions.
I have uninstalled and reinstalled the C++ and CMake extensions.
I am most definitely running an instance of VS Code started from the developer console.
Notes
- The error is not present in the text output console. It is a system pop-up box. I don't know if this might be a clue:
- The build command in the pre-launch task works fine from the command line.

--trace, --trace-expand, and --trace-source=some_cmake_source