Invoke code activity making the system.threading.tasks.parallel issue

Hello.

I am trying to use the system.threading.tasks.parallel.for function in invoke code for my use case in my latest community UiPath. There will be no error on invoke code, and the namespace, class and methods all can be seen clearly via intellisense as I type them out in invoke code.

Now I have already implemented it on UiPath’s new coded automation feature (both coded workflow and coded source file) way before i posted this question, so lack of an assembly should not be an issue in this case. However, I cannot use the coded feature on my end and need to use invoke code instead.

Thus, I am interested to make it work on invoke code activity and not any other typical solutions (e.g., such as the default parallel.foreach activity in UiPath, or using performer/dispatcher, etc). I am open to using external c# or vbnet scripts that is triggered by UiPath if that is doable (which is beyond my current knowledge base).

As for what I have tried to make invoke code work: I have did the basic namespace import, the assembly manipulation on the xaml level, tried downloading the tasks.parallel and threading.tasks class package to UiPath itself, manipulated the .netframework being used… all of it didnt work (maybe i did it wrongly?)

So to the community, please do try out implementing the parallel for loop code on invoke code on your machine (UiPath 23 version onwards) and see if you could make it work. If so, do share your magic.

Here are some screenshots of the error (both vbnet and c# invoke code version)

vbnet
image

c#
image

Hi!

I dont have a solution for you, but I recommend you try to use coded workflows for these kinds of activities:
Studio - Coded Workflow (uipath.com)

Hello thank you for replying.

I already made it worked in coded automation but need to use it in invoke code instead. Will update my main post to make it clearer.

Do you face the same issue on your machine as well when calling the parallel class in invoke code?

I’ll make an attempt, is this in a library or in a process?

Hello again.

Thanks for helping. It is a simple process xaml calling an invoke code activity within it.

Sorry for the late reply, I’m getting the same error as you.

Hey Sven, thanks for helping and confirming that at least I am not alone in facing this issue.

I don’t think this will be solved at all seeing that UiPath is likely banking on just getting people to use the coded automation as older UiPath versions get decommissioned.

Till the next time.