首页 > 解决方案 > Docusign“无法加载文件或程序集 Restsharp”错误

问题描述

我在我的(.netcore 3.1)项目中使用Docusign,并且我还在使用另一个依赖于minio的nuget包。两者似乎都依赖于 Restsharp。

当我尝试运行我的应用程序时,我收到了这个错误:

System.IO.FileLoadException: 'Could not load file or assembly 'RestSharp, Version=106.3.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)'

Docusign 版本:4.4.1

这是从 Visual Studio 中查看的依赖项的屏幕截图: 图片

图片

我尝试在 App.Config 中添加此绑定重定向:

<configuration>
  <runtime>
    <dependentAssembly>
      <assemblyIdentity name="RestSharp" publicKeyToken="598062e77f915f75" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-106.3.1.0" newVersion="106.10.1" />
    </dependentAssembly>
  </runtime>
</configuration>

这没有任何影响。请你帮帮我。非常感谢任何帮助!:)

标签: c#.net-coredocusignapi

解决方案


C# SDK 4.4.1版本取决于RestSharp.dll的具体版本,必须使用106.3.1.0版本。以后的版本就不行了。这是一个已知问题,可能只会在版本 4.5.0 中得到修复,我不知道此时该版本何时发布。唯一的解决方法是找到 restsharp.dll 版本 106.3.1.0 并将其添加为参考或将其放在同一个文件夹中以便可以加载(本来想说把它放在 GAC 但你使用的是 .NET Core )。

修改:实际上,如果你想构建自己版本的 DocuSign.eSign.dll,你可以去https://github.com/docusign/docusign-csharp-client并自己构建代码。


推荐阅读