Legacy to Windows - invokeElement error

Hi,

We are facing error after converting Legacy package to Windows. (Studio version 2022.10.5)

Tried to upgrade and downgrade existing packages but no luck.

invokeElement

Error: UiPath.WorkflowProcessor.Common.Exceptions.UiPathLocalizedException: invokeElement
at UiPath.WorkflowProcessor.Common.Preprocessing.WorkflowDocumentPreprocessor.GetDependencyTree(LoggingScope scope, String xamlFilePath)
at UiPath.Studio.ProjectCompiler.Services.ProjectCompilerService.<>c__DisplayClass10_0.b__0(String wf)

Any update here? We have the same issue.

Have you run Validate Project? It’ll tell you what’s wrong.

There are no validation errors, but as soon as I try to run it it gives the error before even checking for validation or compiling:

22.10.7+Branch.support-v22.10.Sha.13392c2732b65aacecabca1b3a20e5d4ff985eb5

invokeElement

Error: UiPath.WorkflowProcessor.Common.Exceptions.UiPathLocalizedException: invokeElement
at UiPath.WorkflowProcessor.Common.Preprocessing.WorkflowDocumentPreprocessor.GetDependencyTree(LoggingScope scope, String xamlFilePath)
at UiPath.Studio.ProjectCompiler.Services.ProjectCompilerService.<>c__DisplayClass10_0.b__0(String wf)
at System.Linq.Enumerable.SelectArrayIterator2.MoveNext() at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext()
at System.Linq.Enumerable.DistinctIterator1.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at UiPath.Studio.Plugin.Workflow.Execution.Services.ExecutionCompilationService.Compile(String entryWorkflow) at UiPath.Studio.Plugin.Workflow.Execution.Services.ExecutionStartConfigurator.ConfigureAsync(Boolean firstExecutionInBatch, Boolean lastExecutionInBatch, IEnumerable1 batchedDocuments, String entryWorkflow)
at UiPath.Studio.Plugin.Workflow.Execution.Services.WorkflowExecutor.StartExecution(ExecutionConfig config)
at UiPath.Studio.Shell.Execution.Services.ExecutionManagerBaseService.TryStartExecution(ExecutionConfig executionConfig, Boolean validate)
at UiPath.Studio.Shell.Execution.Services.ExecutionManagerService.<>c__DisplayClass27_0.<g__StartExecutionAsync|1>d.MoveNext()
— End of stack trace from previous location —
at UiPath.Studio.Shell.Execution.Services.ExecutionManagerService.ProcessExecutionCommand(ExecutionCommand command, Object item, ExecutionParameters executionParameters)
at UiPath.Studio.Shell.ViewModels.DebugTabViewModel.ExecuteRunCurrentFileAsync()
at UiPath.Studio.App.Desktop.MVVM.Commands.TaskCommand`3.Execute(TExecuteParameter parameter, Boolean ignoreCanExecuteCheck)
at System.Threading.Tasks.Task.<>c.b__128_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2146233088

Go to the Imports tab. Search for and import (double click) each of the System.Linq ones

I’ve found lots of imports missing when converting to Windows

I did add the two highlighted below (as these 3 are the only ones appearing in the search) but I’m still getting the same error.

I’m not seeing System.Linq.Enumerable as an option if I’m supposed to. How do I know what imports I’m supposed to have?

image

Normally imports are done automatically as you type expressions. But the conversion process doesn’t do a good job of finding them and importing them. You only know by the error message. I’ve also found that retyping the offending expression in a new Log Message activity redoes the automatic imports that are necessary. For example, my conversions always end up telling me dictionary isn’t queriable, so I add a new variable and type New Dictionary(of string, object) into the default then delete the variable. Then I also have an expression that I retype in a new Log Message activity:

(From kvp In transactionItem.SpecificContent Order By Array.IndexOf({"Result Details","Success/Fail","Date/Time Processed"}, kvp.Key) Descending).ToDictionary(Function (x) x.Key,Function (x) x.Value)

Retyping this gets it to do the proper imports automatically.

Hi @Caleb_D2

I am able to resolve issue by removing and adding again one workflow.

There was one Invoke Workflow activity was caused this issue. This is really strange that I tried to remove that InvokeWorkflow activity and it worked. It was in init phase of framework. Tried to remove one by one and run. (Not Fun activity though :stuck_out_tongue: )

You need to add it again and it does not show you this error.
In your case this might be different but posting solution for my error.

1 Like

This worked! Thank you! For me it was the Process invocation that caused issues. Deleted the invoke workflow and redragged in the Process workflow and the process ran fine. Nothing extraordinary in the arguments. Just a weird UiPath bug.