简体   繁体   English

参考引用旧的 Dll 并引发错误

[英]Reference References Old Dll and Throws Error

I am using a TwitchLib reference and uses Newtonsoft.Json 7.0.0.我正在使用 TwitchLib 参考并使用 Newtonsoft.Json 7.0.0。 Every time I got to the page that calls Twitch lab I get the following error.每次进入调用 Twitch 实验室的页面时,都会出现以下错误。

Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'无法加载文件或程序集“Newtonsoft.Json,版本=7.0.0.0,Culture=neutral,PublicKeyToken=30ad4fe6b2a6aeed”

I have Newtonsoft.Json, Version=9.0.0.1 installed in my project.我的项目中安装了 Newtonsoft.Json, Version=9.0.0.1。

I have added this to my config to try and resolve the issue.我已将此添加到我的配置中以尝试解决该问题。

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

How can I resolve this issue?我该如何解决这个问题?

In the Nuget package manager console:在 Nuget 包管理器控制台中:

Uninstall-Package Newtonsoft.Json -Force

Install-Package Newtonsoft.Json -Version 6.0.0.0

See here: How to install an older version of package via NuGet?请参阅此处: 如何通过 NuGet 安装旧版本的软件包?

将参考 newVersion="7.0.0.0" 更改为 newVersion="9.0.0.0" 似乎已经解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM