Hi, I picked an API script in C# from Postam and tried using it in UiPath via the Invoke Code Activity.
I have instaled the Restsharp as a dependency in project
When I hoover on the code everything seems ok,
However, I get the error message bellow. It shows that there is no timeout activity for ‘RestClient’, I found it when I hooverd on my mouse.
It appears I am missing something here. This is the error message I get
[Error] Invoke code: No compiled code to run
error CS1061: ‘RestClient’ does not contain a definition for ‘Timeout’ and no accessible extension method ‘Timeout’ accepting a first argument of type ‘RestClient’ could be found (are you missing a using directive or an assembly reference?) At line 2
error CS0117: ‘Method’ does not contain a definition for ‘POST’ At line 3
error CS0246: The type or namespace name ‘IRestResponse’ could not be found (are you missing a using directive or an assembly reference?) At line 16
error CS1061: ‘RestClient’ does not contain a definition for ‘Execute’ and no accessible extension method ‘Execute’ accepting a first argument of type ‘RestClient’ could be found (are you missing a using directive or an assembly reference?) At line 16
12/31/2021 10:59:02 => [Info] InvokeCodeTemplate execution ended in: 00:00:04
12/31/2021 10:59:02 => [Error] RemoteException wrapping System.ArgumentException: No compiled code to run
error CS1061: ‘RestClient’ does not contain a definition for ‘Timeout’ and no accessible extension method ‘Timeout’ accepting a first argument of type ‘RestClient’ could be found (are you missing a using directive or an assembly reference?) At line 2
error CS0117: ‘Method’ does not contain a definition for ‘POST’ At line 3
error CS0246: The type or namespace name ‘IRestResponse’ could not be found (are you missing a using directive or an assembly reference?) At line 16
error CS1061: ‘RestClient’ does not contain a definition for ‘Execute’ and no accessible extension method ‘Execute’ accepting a first argument of type ‘RestClient’ could be found (are you missing a using directive or an assembly reference?) At line 16
at UiPath.Activities.System.Utilities.InvokeCode.RoslynCompilerRunner.Compile(String code, Int32 errLineOffset, Boolean generateInMemory)
at UiPath.Activities.System.Utilities.InvokeCode.CSharpInvoker.GetCompilerRunner(String code, String className, String methodName, Int32 errLineOffset, Boolean inMemory)
at UiPath.Activities.System.Utilities.InvokeCode.NetCodeInvoker.GetCompilerRunner(String userCode, List1 args, String imps, Boolean inMemory) at UiPath.Activities.System.Utilities.InvokeCode.NetCodeInvoker.Run(String userCode, List
1 inArgs, IEnumerable`1 imps, Object args)
at UiPath.Core.Activities.InvokeCode.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location