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 2022. 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
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, Exchange activities and Notes activities don’t support as the following image, as of Dec 2022.

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.


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

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 : Modify logic to use fixed file path (without variable).


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)


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 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}

3 Feedback

Any feedback will be appreciated.

13 Likes
:ambulance: :sos: [FirstAid] Migration to Windows target Framework - Missing Microsoft.Activities.Extensions package - Dictionary Activities
Cannot create cultureinfo variable in Windows mode
Regex Builder Option not showing
Windows converted project now not running (Jan. 2023)
Initialising New Data array datarow of string Windows version
Windows compatibility issues with Windows-Legacy
Unable to set the destination folder for files to be extracted to in Extract/Unzip Files
After update "from Legacy to Windows" to Debug my project is not possible
実行するにはコンパイルする必要があります とエラーが表示される
Invoke workflow error : workflow cannot be found. make sure that it is part of the project
Issue with Windows framework while parsing date format
Error - Assign: Expression Activity type ‘VisualBasicValue`1’ requires compilation
Error - Assign: Expression Activity type ‘VisualBasicValue`1’ requires compilation
An item with the same key has already been added. Key: VisualBasicValue`1_1 error after upgrading to windows
UIPath SOAP (Post) request?
Project build: Generating synthetic test data (project) Add data row error
Message: No data is available for encoding 1252
The Activitie: Microsoft.Activities.Extensions is not working?
「ワークフローファイルの呼び出し」で「ライブラリのコンパイル プロセス中に予期しないエラーが発生しました: 次の呼び出されるワークフローがありません」

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

this post is very appreciated !
Thanks you

1 Like

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

Ragards,
Robinnavinraj S

1 Like