Has anyone successfully attached the VSCode Debugger to a Python toolbox?
I have a little Python toolbox and want to "debug" it in the way as described here:
Debug Python code—ArcGIS Pro | Documentation
But indead of using Visual Studio I want to use Visual Studio Code.
I have created the following launch file (launch.json)
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Attach using Process Id",
"type": "python",
"request": "attach",
"processId": "${command:pickProcess}"
},
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
copied the source of the MyToolbox.pyt file to a new MyToolbox.py file and replaced the source in the MyToolbox.pyt file with:
from MyToolbox import *
After starting my ArcGIS Pro and loading my sample project I started the Visual Studio Code debugger and attached it to the ArcGISPro.exe instance.
Afterwards I run my toolbox script, which doing its job, but the Visual Studio debugger is never triggered although I added some breakpoints!
Anyone an idea what's wrong or missing?
Regards,
Daniel.