AnsweredAssumed Answered

Debugging Python script using Visual Studio in ArcGIS Pro?

Question asked by manishs on Jun 2, 2020
Latest reply on Jun 2, 2020 by manishs

According to these links, one can debug a Python script using Visual Studio in ArcGIS Pro. Debug Python code—ArcPy Get Started | ArcGIS Desktop

ArcGIS Pro and Python - YouTube

I am using ArcGIS pro version 2.5.1 and Visual studio 2019 (16.6.1) . My steps

  1. Downloaded the 'Python development' workload to visual studio Pro 2019.
  2. Edited my .py file to add some intentional errors for testing.
  3. Opened ArcGIS Pro with my tool and my data to be run.
  4. Opened my .py file in Visual Studio and added some breakpoints.
  5. Attached to process in Visual Studio. See image below:
  6. Ran my script tool in ArcGIS Pro.
  7. The tool fails in ArcGIS Pro because it has errors but I am not re routed to Visual Studio to see the error line as I expected. I then removed the errors in the code and left only the breakpoints but I still wasn't able to hit the breakpoints. Again, the tool completed without re-routing me back to visual studio. Has anyone been able to successfully debug Python tools using Visual Studio Pro 2019 in ArcGIS Pro 2.5.1?

Outcomes