1

I am working with a solution in visual studio that has multiple projects in it. One area of the project requires RestSharp 106.10.1, and in another project (that it needs to talk to) we have the Docuign.ESign.dll that has RestSharp 106.3.1 as an interior dependency. When trying to run the project with the Docusing dll, we get a run time error of

"Could not load file or assembly 'RestSharp, Version=106.3.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75'. The system cannot find the file specified."

The dll seemingly has its own version of rest sharp, but it conflicts with the version of rest sharp we are using elsewhere in the solution. I've tried downloading the docusign dll source code, updating the dependencies, and creating a new dll, but that breaks the docusign code, and I've tried doing a binding redirect in an app.config in the project so that it uses its lower version, but I've had no success with that. I could really use some help here, any help would be appreciated.

g10
  • 31
  • 6
  • 1
    Binding redirect is for exactly this scenario, right? What issue did you have with it? – gandaliter Apr 17 '20 at 21:32
  • 1
    solution or project? Your solution would be to have the DocuSign code in it's own project. If you build a project, it creates a dll, it can have different dlls as dependencies. In production you would have to have 2 different versions of RestSharp.dll, which is unfortunate, but seems your only choice – Inbar Gazit Apr 17 '20 at 21:32
  • 1
    which version of RestSharp you guys are using? lower or higher? – Inbar Gazit Apr 17 '20 at 21:33
  • We are using version 106.10.1, the docusign dll is using 106.3.1. The solution currently has the docusign code in its own project, and I have tried building that project as a dll for the other project in the solution to use, but we came across the same issue. – g10 Apr 17 '20 at 21:37
  • I have not worked binding redirects before this, but when trying to add one to the app.config, I added ' ' – g10 Apr 17 '20 at 21:43
  • please correct me here, if I've done something wrong on the redirect. The dll itself should have the correct version (106.3.1) so when it see's the version that exists in the other project (106.10.1), I'm not sure how to handle that – g10 Apr 17 '20 at 21:43

1 Answers1

2

I ran into the same issue about the same time as your post. My situation is a little simpler, but I hope this helps.

Yes, it seems the DocuSign.eSign.dll really wants to use RestSharp version 106.3.1. This may be a bug in the DocuSign DLL, so I hope one of their developers is monitoring the docusignapi tag and can address this.

My project is just a ASP.NET C# WinForms web app which lets you fill in some info and then send a request to DocuSign to send out documents for signatures. All my DocuSign centric code is in a separate assembly, so I should only be dealing with 1 copy of DocuSign.eSign.dll and RestSharp.dll.

When I first created the project, I used the latest versions of DocuSign.eSign (4.3.0). It brought in the dependency of RestSharp 106.3.1, which I promptly updated to 106.10.1 (probably a mistake). Compiling I get a warning about not finding RestSharp 106.3.1 and at runtime, the app crashes when RestSharp 106.3.1 can't be found. I spent most of the day today working with a DocuSign code sample updating various parts (.NET version, DocuSign.eSign, RestSharp) step-by-step to try to get it to use the latest package versions.

This is what works: Update your solution to use the latest versions of DocuSign and RestSharp. When you compile I expect you'll see the conflicting version warning. Then for every project that is showing this warning, modify the app.config file and change the dependentAssembly section for RestSharp to:

  <dependentAssembly>
    <assemblyIdentity name="RestSharp" publicKeyToken="598062e77f915f75" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-110.0.0.0" newVersion="106.0.0.0" />
  </dependentAssembly>

I used an extended range for the oldVersion to make sure the RestSharp version DocuSign wants to use is covered. The newVersion uses "106.0.0.0" instead of "106.10.1" because that's the version number being reported in Visual Studio. If you select RestSharp in the project references and look at its properties, you'll see 106.0.0.0, not 106.10.1. In the build log (when Diagnostics is selected), you'll see this is it's "Fusion name" even though the properties of the file itself will say 106.10.1. Anyway, that's what is working for me.

If I can answer any questions or provide additional information, please let me know.

thanks, randy

RandyB
  • 325
  • 4
  • 13
  • I'm glad to see someone else had a similar issue, and I'm glad you found a fix you could use! Did you need to update any of the code in the docusign dll being that you changed it to use a different version of rest sharp? I had tried to manually update the dependencies and build a new docusign dll, but that had broken some of the code in the dll for me – g10 Apr 19 '20 at 18:37
  • The DocuSign.eSign.dll is the same one I got from NuGet with no modifications. I think the key to solving the problem when the DocuSign DLL goes looking for RestSharp 106.3.1, the app.config tells the binding code we have that version (0.0.0.0 to 110.0.0.0) and when you load it, expect the version to say 106.0.0.0 instead of 106.10.1.0 or 106.3.1. My guess is that makes everyone happy. As I said, that's what is working for me. If you have more questions, I'll try to help. – RandyB Apr 20 '20 at 00:08
  • I believe this issue has been fixed with the latest versions of DocuSign.esign.dll (I'm using 4.5.2) and RestSharp (I'm using 106.11.4.0). – RandyB Jul 16 '20 at 23:05