问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/61281028/dependency-issues-with-docusign-esign-dlls-inherit-restsharp-dependency