gpt4 book ai didi

.net - “Newtonsoft.Json”已经具有为 'Microsoft.CSharp' 定义的依赖项

转载 作者:行者123 更新时间:2023-12-02 17:31:38 24 4
gpt4 key购买 nike

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

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

我尝试复制 DLL 并直接使用它,似乎这个版本 (10.0.2) 中的一些依赖关系被搞砸了。

经过几个小时的研究,终于发现是VS2012和Newtonsoft Json 10.0.2的兼容性问题。

最佳答案

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

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

PM> Install-Package Newtonsoft.Json -Version 9.0.1

更多详细信息: https://github.com/NuGet/Home/issues/5162.

关于.net - “Newtonsoft.Json”已经具有为 'Microsoft.CSharp' 定义的依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44532170/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com