UiPath.Python.Activities.PythonScope not working when "targetFramework": "Windows"

UiPath.Python.Activities.PythonScope not working with “targetFramework”: “Windows”. It works fine when “targetFramework”: “Legacy”.

I have written all my code with “targetFramework”: “Windows”, now converting it back to legacy will be a challenge.

Also why should I downgrade and even UIpath is giving me warning that “Windows-legacy compatibility is phased out and no longer be available for new projects”.

CC: ajayyadavcs@gmail.com


Hello @sugam.srivastava2

Did you try updating the python packages to the latest version?


Hi @Rahul_Unnikrishnan, we are using version python 3.8.2.(stable version) and packages installed in uipath are latest version “UiPath.Python.Activities(version 1.6.0)”
It is working in windows-Legacy but not working in windows.

the same issue I came across, any solutions?

Hi @li_Charlie ,

Please install .NET 5 from the below link and try to execute the code again.

.NET5 link


thank you very much, the issue has been solved after installing this package :+1: :+1: :+1:

1 Like

@li_Charlie, Any time :slight_smile:

One potential cause of this error is that “.NET 5.0 Desktop Runtime (v5.0.17)” is not installed on your machine.

To be sure this is the cause, you can use Event Viewer to see the exact error and some details about how you can fix the error. See below some steps of how you can use Event Viewer:

  1. Open Event Viewer
  2. Start the process in UiPath Studio
  3. Look for an error to appear in Event Viewer (under Windows Logs > Application)
  4. If you have an error saying that .NET is missing, you should download the tool from the URL specified in the error.

I think the issue has something to do with the target framework.

I have created two projects (replicas), one with Windows, and another with Windows legacy. Same Python version (>=3.10) and the same Python package version (1.6.0). Basically, everything is identical except the target framework. And .NET 5 is installed.

Result: The Windows code just doesn’t go inside the Python Scope and gets stuck there, while the legacy one runs as expected.

Update: My hypothesis was incorrect. The target framework was not the issue.

What I did: I installed the entire .NET 5 SDK, instead of just the .NET 5.0 Runtime (which was suggested in one of the posts on the forum), and it worked.

1 Like