Search code examples
docusignapirestsharp

Call to ApiClient.RequestJWTUserToken is throwing a RestSharp exception


I have an empty test web page calling ApiClient.RequestJWTUserToken() as shown below and it immediately throws the RestSharp exception following:

        OAuth.OAuthToken authToken = ApiClient.RequestJWTUserToken(IntegrationKey,
                        ImpersonatedUserGuid,
                        AuthServer,
                        Encoding.UTF8.GetBytes(PrivateKey),
                        1);

System.MissingMethodException: 'Method not found: 'Void RestSharp.RestClient.set_Timeout(Int32)'.'

I have verified the parameters against another working project using the exact same call. The project is using DocuSign 5.10.0 and RestSharp 107.3.0. I have uninstalled / reinstalled both packages and also downgraded to match my other project (5.8.0 and 106.12.0 respectively) but no joy.

Almost feels like some kind of dll hell situation but not sure how to proceed.

Googling the exception has yielded no relevant results. I am hesitant to mess with my working project lest it breaks as well. Hoping someone out there has some insight, thanks for any help.


Solution

  • Apparently uninstalling via NuGet & removing references did not necessarily remove the related binaries from the bin folder, nor all hardcoded references to RestSharp 107 from app.config or web.config's. Doing so and then adding only the DocuSign 5.10.0 (latest stable as of now) package did the trick. Thanks @AlexeyZimarev for the pointer.