'Method not found: RestSharp.IRestRequest RestSharp.RestRequest.AddFile'


#1

OK so title says it all :slight_smile:

I have the same project on two machines they both are new install.

I try to use httprequest activity on both of them Unfortunately on one machine it works like a charm on other i get :

‘Method not found: RestSharp.IRestRequest RestSharp.RestRequest.AddFile’ error on the activity.

Do you have any solution??

I already tried updating .net version and importing restsharp namespaces in to the project.


#2

Hi Poof,

Do you deploy the automations locally, or via orchestrator?
And if via orchestrator, which version are you using?


#3

Bastiaan, they are deployed localy and if tested on affected machine with studio i get this error:

Exception Type: MissingMethodException

System.MissingMethodException: Method not found: ‘RestSharp.IRestRequest RestSharp.IRestRequest.AddFile(System.String, System.String)’.
at UiPath.Web.RestClient.AddAttachments(IDictionary`2 files)
at UiPath.Web.Activities.HttpClient.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.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 resultLocation)


#4

Try to copy all the activities from the machine where it works, from:
C:\Users\xxxUSERxxx\AppData\Local\UiPath\Activities
(xxxUSERxxx needing to be adjusted to the real username)
To the other machine.
Don’t overwrite existing, only add what’s missing.

And then run again & check if it does the trick :wink:


#5

Bastiaan,

Thats not an issue with activities if something its an issue with missing dlls from app-18.x.x folders.
Computer that is ok has less activites then the one with error


#6

Hello,

There seems to be a known issue that HttpRequest will fail if RestSharp version is higher than 105.0.1.0.

It will be fixed in the future.

For now, as a workaround you can try to downgrade any activity that uses RestSharp higher than 105.0.1.0

Hope this helps,
-Andrei


#7

Hi Andrei,

Downgreading worked like a charm, unfortunately after downgrade i couldnt publish the project.

Regards,
M


#8

Oh, what does it say when you try to publish ?


#9

Missing dll