Troubleshooting Guide : Conversion from Windows-Legacy project to Windows project

This topic describes troubleshooting guide regarding conversion from Windows-Legacy project to Windows project as of Dec 2023. Hope this helps those who face these problems.

1 Quick Reference by Error Messages, Situation etc.

Phase Error message / Situation Reference
Open project foobar.xaml: Cannot create unknown type’{clr-Namespace:UiPath.foo.Activities;assembly=UiPath.bar.Activities}ActivityName’. 2.2 Missing Activities package
OR
2.3 Missing activity
Development Unable to set properties because of display matters 2.4 Incorrect display of activity
Development error BC36915: Cannot infer an element type because more than one type is possible. Specifying the type of the array might correct this error. 2.13 AddDataRow activity doesn’t accept array which consist of multiple type in ArrayRow property
Compile foo.xaml’ contains an InvokeWorkflowFile activity with an dynamic expression ‘[bar]’. Expressions are currently not supported. 2.5 Unsupported dynamic file path in InvokeWorkflowFile activity
Compile The following invoked workflows are missing: 2.6 InvokeWorkflowFile activity doesn’t support xaml file which doesn’t exist under project folder
Compile The following workflows are in a least one invocation cycle: 2.14 Recursive logic is not supported (in Studio 23.4 or lower)
Debug An item with the same key has already been added. Key: VisualBasicValue `1_1 2.9 Unable to debug run
Run/Debug XXX is not a supported encoding name 2.11 Unsupported specific character encoding
Run/Debug Expression activity type ‘VisualBasicValue’1’ requires compilation in order to run 2.7 Double quotation matters
OR
2.8 ReadPDFwithOCR(C#)
Run Different behavior than before 2.1 Version of Activities package would be changed
OR
2.12 32bit/64bit matters

2 Contents

2.1 Version of Activities package would be changed

As UiPath platform started to support Windows/CrossPlatform project since 21.10, older activities packages doesn’t support it. These activities package would be upgraded to the nearest compatible stable version (mainly 21.10.x).
This means behavior of the activity (process) might be changed and it’s recommended to test after conversion


2.2 Missing Activities package

As Windows project uses .net 6 based activities package, .net 4.6.1 based activities package which is used in Windows-Legacy project is not supported. For example, Microsoft.Activities.Extensions package doesn’t support Windows project.(In Studio 22.10.4 or later, “No compatible version” message will be shown if the package doesn’t support Windows project…)

If we use conversion tool, the following error will be shown in log.

 foobar.xaml: Cannot create unknown type'{clr-Namespace:UiPath.foo.Activities;assembly=UiPath.bar.Activities}ActivityName'.

:white_check_mark: Solution : Use Windows-Legacy until it supports Windows project OR Find alternative way.


2.3 Missing activity

Even if activities package supports Windows project(.net6), there might be some activities which don’t support Windows project (.net6).
For example, SOAP Request activity (in UiPath.WebApi.Activities package) doesn’t support Windows project as the following image, as of Dec 2023.

image

If we use conversion tool, the following error will be shown.

 foobar.xaml: Cannot create unknown type'{clr-Namespace:UiPath.foo.Activities;assembly=UiPath.bar.Activities}ActivityName'.

:white_check_mark: Solution : Use Windows-Legacy until it supports Windows project OR Find alternative way.

For example, Exchange activities and Notes activities support Windows project since Mail.Activities package 1.21.1 which is bundled in Studio 23.10.0. In this case, upgrading Mail.Activities package to 1.21.1 or above solves this matter.


2.4 Incorrect display of activity (on Designer panel and Properties panel)

Combination of some version of activities package and Windows project cause incorrect display of activity on Designer panel and Properties panel. For example, ForEach activity in UiPath.System.Activities package 22.4.4 is displayed in Windows project, as the following.

:white_check_mark: Solution : Upgrade to the latest stable version of the activities package.
In the above example, upgrading UiPath.System.Activities package to 22.4.5 or 22.10.3 etc will solve this matter.


2.5 Unsupported dynamic file path in InvokeWorkflowFile activity (in Studio 23.4 or lower)

Invoke workflow file activity in Windows project doesn’t support dynamic file path.(Probably because of compiling DLL) If we use it, the following message will be shown.

Could not find file '[varFilepath]'

imgA

:white_check_mark: Solution : Upgrade Studio to 23.10 or higher.


2.6 InvokeWorkflowFile activity doesn’t support xaml file which doesn’t exist under the project folder

Invoke workflow file activity in Windows project doesn’t support xaml file which doesn’t exist under the project folder.(Probably because of compiling DLL). The following error will be shown if set it.

The following invoked workflows are missing:

:white_check_mark: Solution : Modify logic to use xaml file under the project folder or use Library etc.


2.7 Double quotation matters

In Window Legacy-VB project, any double quotation character can be used as start or end character of string literal. However, in Windows project, compiler doesn’t handle double quote except " (0x22) properly and it causes runtime error as the following message. For example (0x201C) causes this error. To make matter worse, static validator doesn’t warn this and compiler doesn’t throw any error.

Expression activity type ‘VisualBasicValue’1’ requires compilation in order to run

The following image is for reproducing this matter.

:white_check_mark: Solution : Replacing (retyping) all the double quotation to " (0x22) in the expression will solve this matter.


2.8 ReadPDFwithOCR(C#)

For some reason, ReadPDFwithOCR activity in Windows-C# project causes the following error.
Probably, it’s bug of the activity.

Expression activity type ‘VisualBasicValue’1’ requires compilation in order to run

:white_check_mark: Solution : Use VisualBasic OR Windows-legacy until it wiil be fixed.
OR As workaround, single ReadPDFwithOCR in a xaml file might work.(We can call it using InvokeWorkflowFile activity)

Note: In Studio 23.10, this matter seems solved.


2.9 Unable to debug run

For some reason, the following error occurs in debug run after conversion.

An item with the same key has already been added. Key: VisualBasicValue `1_1

:white_check_mark: Solution : We can fix it to modify xaml file directly using text editor, as this is caused by duplicated same key. (Please make a backup file to edit xaml file)


2.10 Unable to execute xaml file from commandline with --file option

UiRobot.exe doens’t support to run xaml file in Windows project.

You can only run .NET6 .nupkg files or published process from the UiRobot command line.

:white_check_mark: Solution : run nupkg file with --file option or process with --process option.


2.11 Unsupported specific character encoding

Windows project (.net6) doesn’t support some character encoding such as Windows-1252, shift_jis etc. as default. If we try to use them, the following error is thrown.

XXX is not a supported encoding name

:white_check_mark: Solution : Call the following expression in advance.

System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance)

In UiPath, it’s necessary to call it using InvokeMethod activity as the following.


2.12 32bit/64bit matters

As Windows-Legacy runs as 32-bit process and Windows runs as 64-bit process, there are difference regarding 32/64bit when call other process. For example, InvokePowerShell activity uses 32 bit powershell in Windows Legacy while 64 bit powershell in Windows.
As a result, it might cause difference of behavior.

:white_check_mark: Solution : Modify workflow or script etc. OR change way to call, for example call 32bit program explicitly using StartProcess activity, if necessary.


2.13 AddDataRow activity doesn’t accept array which consists of multiple type in ArrayRow property

In Windows project, AddDataRow activity doesn’t accept array which consist of multiple type in ArrayRow property, although it’s no problem in Windows-Legacy project. The following error will be shown.

error BC36915: Cannot infer an element type because more than one type is possible. Specifying the type of the array might correct this error.

:white_check_mark: Solution : Explicitly define it as Object array as the following.

New Object(){"a",3}

2.14 Recursive logic is not supported (in Studio 23.4 or lower)

As compiler doesn’t support recursive logic, it throws exception in compiling.

 The following workflows are in a least one invocation cycle:

:white_check_mark: Solution : Upgrade Studio to 23.10 or higher.


3 Feedback

Any feedback will be appreciated.

Change log

12/6/2023 Modified document because of Studio 23.10 release

34 Likes

Please updates if there is is any updates on more solution or expected error scenario.

this post is very appreciated !
Thanks you

2 Likes

@Yoichi Thank you very much for this detailed post. Definitely this post will help most of us

Ragards,
Robinnavinraj S

2 Likes

Hello,

I’m using IsNothing in a few places, but I keep getting the Unexpected error has occurred during the library compilation process:
The assembly compilation returned the following errors:

  • ‘IsNothing’ is not declared. It may be inaccessible due to its protection level.

I can see that it comes from Microsoft.VisualBasic namespace, which I already have in my Windows framework process, but there is no Information class, and I don’t really know how to migrate it to Studio? I can see that I have the Microsoft.VisualBasic.Core.dll Assembly in C:\Program Files\UiPath\Studio, but just wanted to ask if anyone can help with making my Windows project use it.

Many thanks!

1 Like

When XAML is opened in a texteditor e.g. notepad++ (Always take Backup before)

Can you confirm the following?

  • grafik

  • grafik

  • grafik

1 Like

HI @Yoichi,

Very nice information, lot of people facing this kind of issue and you provided solutions for that really appreciated :+1: :clap:

Regards,
Arivu

2 Likes

Hi @Yoichi, It’s been really wonderful tutorial. Appreciated your efforts to make this one .

2 Likes

I have a sequence of PowerShell commands in my original Windows-Legacy project, involving (in this order):

“Connect-MicrosoftTeams”
“New-Team”

Prior to being able to use them, I had to install the modules, set the proper execution policy and import the modules for the 1st time, thus having this comment furtherly commented out.

After converting the project to Windows, the sequence of commands was throwing different errors, so I assumed the “32 or 64 bit” matters, as after converting I had to change my database connection to 64bit ODBC one. So I uncommented the sequences and it worked but only to some extent:

“Set-ExecutionPolicy” works.
“Import-Module” works.
“Install-Module” DOESNT WORK, throwing the following exception:

08/28/2023 13:43:24 Invoke Power Shell: Cannot process argument transformation on parameter ‘CallerPSCmdlet’. Cannot convert the “System.Management.Automation.PSScriptCmdlet” value of type “System.Management.Automation.PSScriptCmdlet” to type “System.Management.Automation.PSCmdlet”.

So I cannot go further.

1 Like

Is there anyone facing the issue of Invoke workflow file after conversion.
After conversion of the code Invoke Workflow File needs to set again.
Is there anyone facing the same issue?

1 Like

As noone seems to be paying attention to this, I’m attaching the simplest project ever demonstrating that Invoke Power Shell with the Install-Module command is NOT USABLE on a from scratch, new project on a Windows project, which in fact it WAS on a Legacy one.

failingProject.zip (136.6 KB)

1 Like

I have to be honest, the Windows version of Studio is a pain. The amount of additional work and/or rework required for simple changes to an automation is ridiculous. In addition, the loss of several key activities has removed UiPath as a solution for some automation projects.

I was under the impression that using UiPath as an automation tool was to alleviate the heavy lifting of designing automations.

Get this right before you force the change.

3 Likes

Good afternoon all,

Has anyone encountered the errors below that only appear during compilation? I’m on 2023.10 and I used the built in “Convert to Windows” function by right clicking the project name, UiPath automatically converted and resolved some of the errors that appeared, but not this.

It’s probably to do with the .NET differences between Legacy and Windows, but it doesn’t pinpoint what’s causing this and it’s a fairly complex project, so I don’t know where to look.

I tried testing specific activities, all invoked components work fine on their own, but whenever I try testing anything in the Main.xaml state machine, it tries to compile the whole project and throws that error in any state that I tried testing. Any help would be greatly appreciated:

Unexpected error has occurred during the library compilation process:
The assembly compilation returned the following errors:

  • warning CS1701: Assuming assembly reference ‘System.Linq.Expressions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03XXXXXXX’ used by ‘System.Management.Automation’ matches identity ‘System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03XXXXXXX’ of ‘System.Linq.Expressions’, you may need to supply runtime policy
  • warning CS1701: Assuming assembly reference ‘System.Linq.Expressions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03XXXXXXX’ used by ‘System.Management.Automation’ matches identity ‘System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03XXXXXXX’ of ‘System.Linq.Expressions’, you may need to supply runtime policy
  • (1,10189): error CS0718: ‘Directory’: static types cannot be used as type arguments
  • warning CS1701: Assuming assembly reference ‘System.Linq.Expressions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03XXXXXXX’ used by ‘System.Management.Automation’ matches identity ‘System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03XXXXXXX’ of ‘System.Linq.Expressions’, you may need to supply runtime policy
1 Like

Hi, I have a problem with 2.11
i got message “Encoding Provider does have a public static method name ‘RegisterProvider’ matching the parameter types, generic type argmunets and generic type constraint supplied to InovkeMethod 'Inovke Method”.

Hi!

The “2.5” solution doesn’t work… I have the latest version of studio (2023.10.7) and I get the error “workflow cannot be found. Make sure that it is part of the project…”… I have dynamic invokes for several projects and many xaml outside the project folder (includes the 2.6 solution) and this way all my projects will not work in the new project window… I believe this is a giant step back in the evolution of UiPath system, as it is forcing me to remain in the legacy, even in new projects… But what happens when the legacy is abandoned?

Thank you.