Not all code paths return a value in lambda expression of type 'Func<object>'


I was just trying to assign a simple array but this error keeps popping up, but sometimes it does not and everything works fine, but a lot of time it does and I am not sure why can someone please tell me when I went wrong?

Hi,

Can you try the following?

new Int32[] {7,5,2,4,3,9}

Regards,

Thanks Yoichi, i think i know the problem now. It was asking for a C# expression and I provided a VB.NET one instead. Is there a way to switch from C# to VB within the Uipath Studio?

1 Like

You can use Invoke Code activity, but its not a efficient way :slight_smile: @Zk_Tan

Thanks, is there any other way that I could switch from C# to VB? I notice when I start a new Project/process it gives me the option of coding in C# or VB, however when i am in the workflow page and click New, it does not give me the same option