<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Has anyone successfully attached the VSCode Debugger to a Python toolbox? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/has-anyone-successfully-attached-the-vscode/m-p/1092605#M62182</link>
    <description>&lt;P&gt;Has anyone successfully attached the VSCode Debugger to a Python toolbox?&lt;/P&gt;&lt;P&gt;I have a little Python toolbox and want to "debug" it in the way as described here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/debugging-python-code.htm" target="_blank" rel="noopener"&gt;Debug Python code—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But indead of using Visual Studio I want to use Visual Studio Code.&lt;/P&gt;&lt;P&gt;I have created the following launch file (&lt;FONT face="courier new,courier"&gt;launch.json&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
    "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"
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;copied the source of the &lt;FONT face="courier new,courier"&gt;MyToolbox.pyt&lt;/FONT&gt; file to a new &lt;FONT face="courier new,courier"&gt;MyToolbox.py&lt;/FONT&gt; file and replaced the source in the &lt;FONT face="courier new,courier"&gt;MyToolbox.pyt&lt;/FONT&gt; file with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from MyToolbox import *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Afterwards I run my toolbox script, which doing its job, but the Visual Studio debugger is never triggered although I added some breakpoints!&lt;/P&gt;&lt;P&gt;Anyone an idea what's wrong or missing?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Aug 2021 08:11:42 GMT</pubDate>
    <dc:creator>dstrigl</dc:creator>
    <dc:date>2021-08-26T08:11:42Z</dc:date>
    <item>
      <title>Has anyone successfully attached the VSCode Debugger to a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/has-anyone-successfully-attached-the-vscode/m-p/1092605#M62182</link>
      <description>&lt;P&gt;Has anyone successfully attached the VSCode Debugger to a Python toolbox?&lt;/P&gt;&lt;P&gt;I have a little Python toolbox and want to "debug" it in the way as described here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/debugging-python-code.htm" target="_blank" rel="noopener"&gt;Debug Python code—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But indead of using Visual Studio I want to use Visual Studio Code.&lt;/P&gt;&lt;P&gt;I have created the following launch file (&lt;FONT face="courier new,courier"&gt;launch.json&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
    "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"
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;copied the source of the &lt;FONT face="courier new,courier"&gt;MyToolbox.pyt&lt;/FONT&gt; file to a new &lt;FONT face="courier new,courier"&gt;MyToolbox.py&lt;/FONT&gt; file and replaced the source in the &lt;FONT face="courier new,courier"&gt;MyToolbox.pyt&lt;/FONT&gt; file with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from MyToolbox import *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Afterwards I run my toolbox script, which doing its job, but the Visual Studio debugger is never triggered although I added some breakpoints!&lt;/P&gt;&lt;P&gt;Anyone an idea what's wrong or missing?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 08:11:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/has-anyone-successfully-attached-the-vscode/m-p/1092605#M62182</guid>
      <dc:creator>dstrigl</dc:creator>
      <dc:date>2021-08-26T08:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone successfully attached the VSCode Debugger to a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/has-anyone-successfully-attached-the-vscode/m-p/1160982#M64279</link>
      <description>&lt;P&gt;I've got the same question. Did you manage to get it working? So far I haven't been able to get this to work.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 22:24:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/has-anyone-successfully-attached-the-vscode/m-p/1160982#M64279</guid>
      <dc:creator>DrewDowling</dc:creator>
      <dc:date>2022-04-04T22:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone successfully attached the VSCode Debugger to a Python toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/has-anyone-successfully-attached-the-vscode/m-p/1168693#M64422</link>
      <description>&lt;P&gt;I'm using VSCode to attach to my ArcPro 2.9 toolbox's Tool the same as you are and I'm using it to debug my Tool Validation code as described on the page you linked. You're right in your observation: Breakpoints I set are not recognized/do not halt the code but any print(messages) I insert are printed to the DEBUG CONSOLE tab. At least I'm getting some feedback while testing the Tool parameters. I'll strip out the print statements when I'm done.&lt;/P&gt;&lt;P&gt;If anyone knows how to get VSCode to recognize the Breakpoints and actually halt the code execution, I would be eternally grateful.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 12:20:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/has-anyone-successfully-attached-the-vscode/m-p/1168693#M64422</guid>
      <dc:creator>BrianWoodman</dc:creator>
      <dc:date>2022-04-28T12:20:40Z</dc:date>
    </item>
  </channel>
</rss>

