Cannot publish project after Studio >= 2024.4 with Coded Source Files

I cannot publish one of my projects in Studio version >= 2024.4

I get the following errors:

image

I see two assemblies in the following directories.

[PATH TO MY PROJECT]\.local\.codedworkflows\.dt\81a32ae4cc484569a6b8e7321b523465\GP_API_Monitor.Core.dll
[PATH TO MY PROJECT]\.local\.codedworkflows\.dt\b0951c85c2ad4245873d46c92c627968\GP_API_Monitor.Core.dll

It is important to note that the project is valid on version 2023.10.7

I am able to publish the project normally on version 2023.10.7 when trying to use the exact same commit that raises the error on Studio >= 2024.X

The issue is related to Coded Source files.

The only .cs file i have in my project (other than the ones studio generate in ./local and ./codedworkflows) is this:

namespace GP_API_Monitor
{   
    public enum StatusEscrituracao {
        PENDING,
        IN_PROGRESS,
        BOOKKEEPING,
        ERROR,
        RETRY
    }
}

and is located in ./CodedSources/Enums.cs.

I have a single file in the project that uses said enum by taking one intance as an input argument:

If i delete both the .cs file and the workflow using it, the project suddenly becomes publishable again.

(It becomes publishable again even without editing .local/.codedworkflows/WorkflowRunnerService.cs !)

Hi, Henri! What studio version are you using exactly? This has been fixed on our latest release, 24.10. If this is still happening after you upgrade, can you please share the project with us?

I’m currently using 2024.10.1.

Upon trial and error, i’ve found that the problem occurs because of a For Each activity on a list of the enumerable type. Changing from List(Of MyEnum) to an array also didn’t work.

I’ve managed to create a Minimal, Reproducible Example which i’m attaching:

CodedEnum_MRE.zip (51.7 KB)

A sidenote: It seems Studio cannot find the new namespace in the editor’s import tab unless you create a variable of MyEnum first, thought i didn’t test further.

[Edit 1] Just for the sake of helping readers that need a workaround while we wait for a fix: you can simply iterate over Enumerable.Range(0, enumList.Length) in the For Each activity and then use enumList(currentNumber)

[Edit 2] I’ve also tested with using a user-defined class instead of enum and had the same problem.

[Edit 3] I was able to publish the project normally with Studio 2023.10.7

Still using 2024.10.1 I’ve found another similar bug.

It bugs in the same way if you try to use a coded enum type in a switch activity.

Interestingly you can execute the code normally and it runs as expected.

The problem only arises when publishing the project.

Switch MVE.zip (138.7 KB)

I’ve also discovered that if you try to use the AppendToCollection activity, it also makes the project unpublishable.

Note the ItemServico custom class.

Also want to add the relevant activity packages’ versions that i’m using:

“UiPath.UIAutomation.Activities”: “24.10.3”
“UiPath.System.Activities”: “24.10.4”

For anyone looking for a workaround just use the InvokeMethod activity to call Add on the collection