You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of VSCode v1.35.1, a launch configuration defined in launch.json that uses "${command:pickProcess}" as its "processId" value - in order to prompt for a process to attach to - does so before running any pre-launch tasks (preLaunchTask property).
Is this by design?
Is there a way to reverse this order?
The reason I want my prelaunch task to run first is twofold:
generally, since my prelaunch task includes building, I want the launch to be aborted if building fails.
specifically, my prelaunch task creates the process that I then want to attach to.
Taking a step back, my ideal solution would be to have the prelaunch task not only create the process to attach to, but to have the launch configuration automatically attach to it afterwards, but I haven't found a way to do that, given that:
there seems to be no way to populate a launch-configuration property from an arbitrary shell command (you can only call VSCode-internal commands via ${command:...}).
Note: I hit this limitation when trying to debug binary PowerShell modules via an external PowerShell console. I've since realized that the C# debugger automatically attaches to any external process created via a "request": "launch" launch configuration, so launching a PowerShell console that way (with a startup command that imports the binary module) is sufficient.
As of VSCode v1.35.1, a launch configuration defined in
launch.jsonthat uses"${command:pickProcess}"as its"processId"value - in order to prompt for a process to attach to - does so before running any pre-launch tasks (preLaunchTaskproperty).The reason I want my prelaunch task to run first is twofold:
generally, since my prelaunch task includes building, I want the launch to be aborted if building fails.
specifically, my prelaunch task creates the process that I then want to attach to.
Taking a step back, my ideal solution would be to have the prelaunch task not only create the process to attach to, but to have the launch configuration automatically attach to it afterwards, but I haven't found a way to do that, given that:
starting the debugger from the command line isn't supported yet - though support is being considered - see Suggestion: Start VSCode debugger from the command-line #10979
there seems to be no way to populate a launch-configuration property from an arbitrary shell command (you can only call VSCode-internal commands via
${command:...}).Note: I hit this limitation when trying to debug binary PowerShell modules via an external PowerShell console. I've since realized that the C# debugger automatically attaches to any external process created via a
"request": "launch"launch configuration, so launching a PowerShell console that way (with a startup command that imports the binary module) is sufficient.