gpt4 book ai didi

visual-studio-2012 - 'Microsoft.Rest.ClientRuntime' 已经为 'Newtonsoft.Json' 定义了依赖项

转载 作者:行者123 更新时间:2023-12-04 02:11:00 32 4
gpt4 key购买 nike

尝试通过 Nuget 安装包到 VS2012 时遇到以下错误。

PM> install-package microsoft.rest.clientruntime
Attempting to resolve dependency 'Newtonsoft.Json (≥ 6.0.8)'.
Install-Package : 'Microsoft.Rest.ClientRuntime' already has a dependency defined for 'Newtonsoft.Json'.
At line:1 char:16
+ install-package <<<< microsoft.rest.clientruntime
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

许多地方都提到了这个问题,包括 here ,但无一异常(exception)的建议是更新到最新版本的 Nuget。

我正在运行最新版本,但未能解决此问题。Nuget 版本:2.8.60318.667

我还尝试创建一个全新的解决方案并安装具有相同结果的相同包,因此它肯定与 Nuget 有关,而不是项目。

最佳答案

问题是您使用的 NuGet 版本太旧。您至少需要 NuGet 版本 2.12。

Visual Studio 2012 不支持最新的 Microsoft.Rest.ClientRuntime 所需的 NuGet 2.12,因为它具有针对 .NETStandard 的依赖项组,旧版本的 NuGet 并不知道这些依赖项组,导致 已经具有依赖项为错误定义。

因此您需要升级您的 Visual Studio 版本,或者尝试使用旧版本的 Microsoft.Rest.ClientRuntime NuGet 包,或者不使用 NuGet 并直接从 nuget.org 下载 Microsoft.Rest.ClientRuntime NuGet 包和提取所需的程序集。

关于visual-studio-2012 - 'Microsoft.Rest.ClientRuntime' 已经为 'Newtonsoft.Json' 定义了依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38360723/

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