Might be related to this topic.
I’m getting the exact same errors, but using native Windows 10 and no VM involved.
The following combination seems to be problematic:
- Have Func<…> as function parameter for a coded workflow in combination with some class as type.
- Call that workflow from another workflow (like Main.cs)
That’s all it takes to break the project!
With Version 23.10.7 this worked! After updating to 24.10.1 the compiler does somthing different:
Unexpected error has occurred during the library compilation process:
The assembly compilation returned the following errors:
* D:\TestProject\.local\.codedworkflows\WorkflowRunnerService.cs(23,42): error CS0234: The type or namespace name 'TestClass' does not exist in the namespace 'TestProject.lib' (are you missing an assembly reference?)
* D:\TestProject\.local\install\lib\Test\Test+TestClassActivity.cs(12,43): error CS0234: The type or namespace name 'TestClass' does not exist in the namespace 'TestProject.lib' (are you missing an assembly reference?)
* D:\TestProject\.local\install\lib\Test\Test+TestClassActivity.cs(26,43): error CS0234: The type or namespace name 'TestClass' does not exist in the namespace 'TestProject.lib' (are you missing an assembly reference?)
* D:\TestProject\.local\install\lib\Test\Test+TestClassActivity.cs(19,186): error CS0234: The type or namespace name 'TestClass' does not exist in the namespace 'TestProject.lib' (are you missing an assembly reference?)
* D:\TestProject\.local\install\lib\Test\Test+TestClassActivity.cs(19,98): error CS0234: The type or namespace name 'TestClass' does not exist in the namespace 'TestProject.lib' (are you missing an assembly reference?)
* D:\TestProject\.local\install\lib\Test\Test+TestClassActivity.cs(19,261): error CS0234: The type or namespace name 'TestClass' does not exist in the namespace 'TestProject.lib' (are you missing an assembly reference?)
* D:\TestProject\.local\install\Main+MainActivity.cs(47,17): warning SYSLIB0046: 'ControlledExecution.Run(Action, CancellationToken)' is obsolete: 'ControlledExecution.Run method may corrupt the process and should not be used in production code.'
* D:\TestProject\.local\install\lib\Test\Test+TestClassActivity.cs(55,47): error CS1503: Argument 1: cannot convert from 'System.Func<TestProject.lib.TestClass.Something>' to 'System.Func<lib.TestClass.Something>'
Please see the example attached:
TestProject.zip (4,5 KB)
*update*
Seems like there’s a problem resolving the namespaces and Func<> has a special role here:
namespace lib.TestClass
{
public class Something
{
public string SomeProperty { get; set; }
}
public class TestClass : CodedWorkflowBase
{
[Workflow]
// this works!
//public void Execute(global::lib.TestClass.Something something) { }
// ...but this doesn't compile!
public void Execute(Something something) { }
// this also doesn't compile
//public void Execute(Func<global::lib.TestClass.Something> getSomethingFunc) { }
}
}
*another update*
Now, after rewriting the code to not use Func<> parameters it finally compiles.
Next problems:
calling system.GetCredential(…) throws a timeout exception (immediately) but only when having a breakpoint set at specific lines…
Besides that, those breakpoints don’t even work. Breakpoints set at some later point in the code just get ignored. No way to debug there…
After getting everything right (without debugging), the program runs and does what it should do on my machine so time to publish right?
But wait, UiPath has another surprise for me:
Unexpected error has occurred during the library compilation process:
Unable to create activity builder for lib\Something\SomeClass. Reason was 'Value cannot be null. (Parameter 'key')'.
Seriously!?!