In visual studio code your debug options can be changed in the launch.json file. You can get to this file quickly through debug. Simply click the cog icon to open the json file.
Here you will see configurations for your setup.
"configurations": [
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId":"${command:pickProcess}"
}
]
name refers to the option inside the debug dropdownlist.
Find the configuration using processId and change this to processName
processName is the process name to attach to. If this is used, processId should not be used.
The process name will be the .exe of the process id you'd normally be selecting. Once this change is made next time you debug on the option you will automatically attach to your specified process if it is running.
"configurations": [
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processName":"someProcess.exe"
}
]