I have a situation where Docusign API is referencing the RestSharp signed assembly with a public key token of 598062e77f915f75. In the same project I am using the Twilio API which also references the unsigned Restsharp assembly, obviously with a null public key token.
I can make one or the other work but not both at the same time since I can't add both the signed and unsigned RestSharp references since they both have the same name.
When I have a reference to the signed assembly, the Docusign part works but the Twilio code errors with this:
Could not load file or assembly 'RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
When I reference the unsigned assembly, Docusign errors with this:
Could not load file or assembly 'RestSharp, Version=100.0.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Is there any way around this?
I have tried binding redirects in every combination I can think of:
<dependentAssembly>
<assemblyIdentity name="RestSharp" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="105.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="RestSharp" publicKeyToken="598062e77f915f75" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="105.2.3.0" />
</dependentAssembly>