简体   繁体   English

Newtonsoft.json版本错误

[英]Newtonsoft.json version error

I am using TFS server and just get all the latest version from the server and when I run the code it show newtonsoft.json doesn't match with the dependency. 我正在使用TFS服务器,只是从服务器获取所有最新版本,当我运行代码时,它显示newtonsoft.json与依赖项不匹配。 So I remove it and just install it again (latest version 9.0.1). 因此,我将其删除,然后再次安装(最新版本9.0.1)。 But when I right click on the newtonsoft.json property it shows version 4.5.0 (shown in the below image) 但是,当我右键单击newtonsoft.json属性时,它将显示版本4.5.0(如下图所示) 在此处输入图片说明

And when I run this program I got this error 当我运行该程序时,出现此错误

"An exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll but was not handled in user code “ mscorlib.dll中发生类型'System.IO.FileLoadException'的异常,但未在用户代码中处理

Additional information: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. 附加信息:无法加载文件或程序集“ Newtonsoft.Json,版本= 6.0.0.0,区域性=中性,PublicKeyToken = 30ad4fe6b2a6ed”或其依赖项之一。 The located assembly's manifest definition does not match the assembly reference. 找到的程序集的清单定义与程序集引用不匹配。 (Exception from HRESULT: 0x80131040)" (来自HRESULT的异常:0x80131040)

在此处输入图片说明

I tried the all steps from the following link 我尝试了以下链接中的所有步骤
How can I fix assembly version conflicts with JSON.NET after updating NuGet package references in a new ASP.NET MVC 5 project? 在新的ASP.NET MVC 5项目中更新NuGet包引用后,如何解决与JSON.NET的程序集版本冲突?

尝试更新库。在包管理器控制台中右键单击以下命令。

Update-Package –reinstall Newtonsoft.Json

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

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