How can I change targetFramework back to Windows-legacy?

After creating a new project with the targetFramework of Windows, I am unable to copy its activities to a different project that uses the older Windows-legacy framework. I am also unable to invoke the new workflow from the Windows-legacy framework project.

How can I change the targetFramework back to Windows-legacy project?

UiPathLegacy

2 Likes

Hi @grosner

One of the way to change the target framework and expression language back is through project.json file as in the below in line screenshot.

You can access this file in your projects root directory. Hope this will be helpful.

Kindly check/test the given solution and close the topic by marking the solving post as ‘solution’

Thank you.

2 Likes

After editing the Project.json and changing the targetFramework to Legacy, attempting to open the Main.xaml workflow, in the project, produces the following error messages:

Is there an alternate way to change the targetFramework or to resolve these errors?

UiPath-Cannot Open Item

12/04/2021 09:49:10 Could not find member ‘Settings’ in type ‘Error’. Row: 5, Column: 4
12/04/2021 09:49:10 Could not find type ‘System.Collections.Generic.List(AssemblyReference)’ in assembly ‘System.Private.CoreLib’. Row: 46, Column: 6
12/04/2021 09:49:10 Could not find type ‘System.Collections.Generic.List(String)’ in assembly ‘System.Private.CoreLib’. Row: 11, Column: 6
12/04/2021 09:49:10 Could not find type ‘System.Collections.Generic.List(AssignOperation)’ in assembly ‘System.Private.CoreLib’. Row: 102, Column: 10
12/04/2021 09:49:10 Could not find type ‘System.Collections.Generic.Dictionary(String,Object)’ in assembly ‘System.Private.CoreLib’. Row: 95, Column: 8
12/04/2021 09:49:10 Could not find type ‘System.Collections.Generic.List(ITarget)’ in assembly ‘System.Private.CoreLib’. Row: 138, Column: 22

Hi @grosner

I normal case changing from ‘windows’ to ‘legacy’ and ‘legacy’ to ‘windows’ will work through project.json file change on one condition All dependency should be compatible with the target framework.

For example:
In the below I changed the project from ‘legacy’ to ‘windows’ (means .Net Framework4.6.1 to 5.0) but UiPath.PDF.Activities are not compatible with it.

As per the your above screenshot ‘System.Private.CoreLib’ in your Main.xaml is not compatible with ‘Legacy’ I guess. can you please confirm?

Yes in order to use all UiPath Packages, I recommended to use ‘Window-Legacy’ since it will be compatible with .Net Framework 4.6.1 onwards.

Hope you got an idea behind this compatibility modes. Thank you.

Thank you for the reply. Checking all imports for this project does not show System.Private.Corelib. I was searching for a way to disable this particular dependency so that I could revert to the Legacy targetFramework.

Any other suggestions? (Otherwise I will must recreate the workflow, step by step, in order to have it work in Legacy framework).

System.Private.CoreLib.dll is the main runtime library on .NET core. Some of the UiPath Package might using it internally.

To summarize this thread for future readers:
I have two UiPath Projects

  • Project 1 - Created using Windows-Legacy Compatibility
  • Project 2 - Created using Windows Compatibility.
    I cannot invoke a workflow in Project 2, from Project 1.

Solution(s);
Solution 1 - Update Project 1’s Project.json file so the targetFramework = “Windows”. Now both Project 1 and Project 2 use the “Windows” compatibility and work as expected.

Alternative solution:
If simply changing the Project.json targetFramework in Project 2 back to “Legacy” does not work then:
Recreate Project 2 in Windows-Legacy compatibility. This requires redoing each and every activity, because (in my case) I could not simply copy and paste the activities from Project 2 (Windows compatibility) to Project 1 (Legacy).

3 Likes

Kindly check/test the given solution and close the topic by marking the solving post as ‘solution’. So this will be useful others as well.

Thank you.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.