docusign / docusign-esign-csharp-client

The Official Docusign C# Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://developers.docusign.com/docs/esign-rest-api/sdks/csharp/
MIT License
129 stars 159 forks source link

RestSharp when shared as a dependency. #101

Closed gobenb closed 4 years ago

gobenb commented 8 years ago

Using APIs from Docusign, Twillo and Auth0. All 3 have RestSharp.dll as a dependancy.

If I use the RestSharp.dll included with the Docusign package, Docusign works well but Auth0 and Twillio give errors: Could not load file or assembly 'RestSharp, Version=104.1.0.0, Culture=neutral, PublicKeyToken=null'

If I use the normal RestSharp.dll (Install-Package RestSharp), Twillio and Auth0 work fine but I get an error when using Docusign: Could not load file or assembly 'RestSharp, Version=100.0.0.0, Culture=neutral, PublicKeyToken=5xxxxxxxxxxxx'

Adding binding redirects does not solve the issue. I get the same problem only the log says "PUBLIC KEY MISMATCH" instead of "MAJOR VERSION".

I may be wrong, but I think the issue lies on the Docusign side since Twillio and Auth0 work with RestSharp from the source rather than a special .dll.

gobenb commented 8 years ago

Temporarily solved the issue by renaming the RestSharp.dll that was included with the Docusign package to "RestSharpDocusign.dll" and copied that into my project.

I modified the assembly bindings so that when version 100.0.0.0 was called it would load the special "RestSharpDocusign.dll" with the publicKeyToken Docusign wanted. Anything else would utilize the standard RestSharp.dll with a null publicKeyToken.

<dependentAssembly>
    <assemblyIdentity name="RestSharp" publicKeyToken="null" culture="neutral" />
    <bindingRedirect oldVersion="100.0.0.1-105.2.3.0" newVersion="105.2.3.0" />
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="RestSharp" publicKeyToken="598062e77f915f75" culture="neutral" />
    <codeBase version="100.0.0.0" href="ult/RestSharpDocusign.dll" />
</dependentAssembly>
gobenb commented 8 years ago

Final solution was to download the source code for the DocuSign .dll, open in Visual Studio and replace the RestSharp.dll with the current version from Nuget. Then I rebuilt the .dll and added it to my project. Using the top dependantAssembly in my code above, the Docusign .dll now references the same RestSharp.dll as the other services do with a null publicKeyToken.

LarryKlugerDS commented 5 years ago

We are investigating updating to the current version of RestSharp. Thank you for your comments on this issue.

raminrownaghi commented 4 years ago

Any update on this we also facing similar issues with our project referencing RestSharp Version 106.10.1 while DocuSign needs Version 106.3.1 instead

brprigge commented 4 years ago

Ditto. Having trouble with this dependency.

LarryKlugerDS commented 4 years ago

I'm sorry about this issue. I have filed DCM-4116 to have the version updated. I have also filed DCM-4117 for us to provide build instructions to help enable developers to rebuild the SDK as needed.

RajRele commented 4 years ago

Updated the DocuSign NuGet package with RestSharp dependency, please try to get a pre-release version https://www.nuget.org/packages/DocuSign.eSign.dll/4.5.0-rc

RajRele commented 4 years ago

Closing this as resolved, open a new issue if you are facing any issues. thank you

brprigge commented 4 years ago

Verified working. Thanks!