I encountered a reproducible bug while developing a small C# process with coded workflows.
Apparently, the type detection of the return value of a coded workflow is not working properly. When I want to return a string array from the coded workflow, the system detects just a string.
Unexpected error has occurred during the library compilation process:
Unable to create activity builder for CodedWorkflowNotCallable. Reason was 'Object of type 'System.Activities.OutArgument`1[System.String[]]' cannot be converted to type 'System.Activities.OutArgument`1[System.String]'.'.`
I was able to find the root of the problem. It’s in the WorkflowRunnerService.cs
located in the project path .local/.codedworkflows
. This file gets automatically generated on every run of the project. That’s why I can’t correct the issue by hand, changing the type to just string.
After fiddling around, I found this error to be kind of generic to the type detection, when using the full namespace as part of the return type in the coded workflow.
Unexpected error has occurred during the library compilation process:
The assembly compilation returned the following errors:
* C:\Users\[..]\Documents\UiPath\Coded_Workflow_Type_Bug\.local\.codedworkflows\WorkflowRunnerService.cs(31,16): error CS0118: 'System' is a namespace but is used like a type
[...]
This screenshot provided shows both types of error (with the coded workflow on the left and the generated code from UiPath in WorkflowRunnerService.cs
on the right.
Studio 2024.10.4-beta.17693 - 8/29/2024
Community License
Per-user Installation
License Provider: Orchestrator
Activation ID:
Microsoft Windows 11 Pro 64-bit
8.0.7
A code example is provided here: Coded_Workflow_Type_Bug.zip (152.8 KB)