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'.
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.
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'.
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.
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]'
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:
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.
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
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
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.
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
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.
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.
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:
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