'Newtonsoft.Json'已经具有为'Microsoft.CSharp'定义的依赖项 [英] 'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp'

查看:227
本文介绍了'Newtonsoft.Json'已经具有为'Microsoft.CSharp'定义的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在安装NewtonSoft.Json,用于在.NET应用程序中解析Json.当我使用Visual Studio(VS)2012时,无法通过NuGet进行安装. 这是我得到的错误:

I'm installing NewtonSoft.Json for parsing Json in .NET application. When I'm using Visual Studio(VS) 2012, it can not be installed via NuGet. This is the error I have got:

'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp'

我试图复制DLL并使用它,似乎在此版本(10.0.2)中搞砸了一些依赖项.

I tried to copy the DLL over and just use it, seems like some dependencies screwed up in this version (10.0.2).

经过几个小时的研究,终于发现这是VS2012与Newtonsoft Json 10.0.2兼容的问题.

After few hours research, finally I've found out it is the problem of the compatibility of VS2012 and Newtonsoft Json 10.0.2.

推荐答案

,因为VS 2012的NuGet程序包管理器(版本2.8.60318.667)不支持.NETStandard(用于最新的Newtonsoft Json Parser Lib). https://github.com/NuGet/Home/issues/3131

because NuGet Package Manager (Version 2.8.60318.667) for VS 2012 does not support .NETStandard (Used for Latest Newtonsoft Json Parser Lib. https://github.com/NuGet/Home/issues/3131

我通过安装较旧版本的Newtonsoft Json解决了此问题:

I resolve this issue by installing older version of Newtonsoft Json:

PM> Install-Package Newtonsoft.Json -Version 9.0.1

有关以下内容的更多详细信息: https://github.com/NuGet/Home/issues/5162

More details on: https://github.com/NuGet/Home/issues/5162 .

这篇关于'Newtonsoft.Json'已经具有为'Microsoft.CSharp'定义的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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