将Newtonsoft.Json更新到版本10

时间:2017-06-09 15:24:27

标签: .net json.net nuget docusignapi nuget-package

当我将Newtonsoft.Json更新为版本10时,我在运行DocuSign.eSign.dll时出现以下错误

  

'DocuSign.eSign.Client.Configuration'的类型初始化程序引发了异常。 I:无法加载文件或程序集'Newtonsoft.Json,Version = 8.0.0.0,Culture = neutral,PublicKeyToken = 30ad4fe6b2a6aeed'或其中一个依赖项。

     

系统无法找到指定的文件。“DocuSign.eSign.Client.Configuration”的类型初始化程序引发了异常。 I:无法加载文件或程序集'Newtonsoft.Json,Version = 8.0.0.0,Culture = neutral,PublicKeyToken = 30ad4fe6b2a6aeed'或其中一个依赖项。系统找不到指定的文件。

这使我无法更新我拥有的其他Nuget包。

2 个答案:

答案 0 :(得分:1)

尝试将以下内容添加到配置文件中:

 <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0"/>
</dependentAssembly>

更多详情:https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/dependentassembly-element

答案 1 :(得分:0)

DocuSign.eSign.dll(v2.1.4)取决于NewtonSoft.Json.dll(v8.0.3)。因此升级到版本10将引发编译错误。

考虑将您的其他依赖项移动到另一个项目中,这样您就可以在需要新版本的特定项目中升级NewtonSoft.Json.dll。

相关问题