如何解决与JSON.NET集版本冲突的一个新的ASP.NET MVC项目5更新的NuGet包引用后? [英] How can I fix assembly version conflicts with JSON.NET after updating NuGet package references in a new ASP.NET MVC 5 project?

查看:689
本文介绍了如何解决与JSON.NET集版本冲突的一个新的ASP.NET MVC项目5更新的NuGet包引用后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了VS 2013(更新一)一个新的ASP.NET MVC 5 Web项目,然后更新了所有的Nu​​Get包。当我生成项目,我得到以下警告:

I created a new ASP.NET MVC 5 web project in VS 2013 (Update 1) then updated all NuGet packages. When I build the project, I get the following warning:

警告MSB3243:没有办法解决冲突Newtonsoft.Json,版本6.0.0.0 =文化=中性公钥= 30ad4fe6b2a6aeed和Newtonsoft.Json,版本= 4.5.0.0,文化=中性公钥= 30ad4fe6b2a6aeed

warning MSB3243: No way to resolve conflict between "Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" and "Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed".

当我检查web.config,但是,我看到有约束力重定向到位:

When I check the web.config, however, I see that a binding redirect is in place:

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

这是完全警告建议是什么。

Which is exactly what the warning advises.

我怎样才能解决这个警告?

How can I fix this warning?

推荐答案

下面的步骤我用来固定警告:

Here the steps I used to fix the warning:


  • 在VS卸载项目

  • 编辑.csproj的文件

  • 搜索到Newtonsoft.Json装配的所有引用

    • 发现了两个,一个V6和一个V5

    • 替换参考V5与V6

    这篇关于如何解决与JSON.NET集版本冲突的一个新的ASP.NET MVC项目5更新的NuGet包引用后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆