【问题标题】:Version conflict in .net core.net core 中的版本冲突
【发布时间】:2017-09-26 15:49:19
【问题描述】:

我在我的项目中尝试使用 Microsoft.Azure.Management.Fluent 时遇到此错误。

严重性代码项目描述文件行抑制状态 检测到错误 NU1607 ProjectX.Auth.Web 版本冲突 Microsoft.IdentityModel.Clients.ActiveDirectory。参考包 直接从项目中解决这个问题。

ProjectX.Auth.Web (>= 1.0.0) -> Microsoft.AspNetCore.All (>= 2.0.0) -> Microsoft.Extensions.Configuration.AzureKeyVault (>= 2.0.0) -> Microsoft.IdentityModel.Clients.ActiveDirectory (>= 3.14.1)

ProjectX.Auth.Web (>= 1.0.0) -> ProjectX.Auth.Infrastructure (>= 1.0.0) -> ProjectX.Shared.Infrastructure (>= 1.0.0) -> ProjectX.Shared.ServiceBus (>= 1.0.0) -> Microsoft.Azure.Management.Fluent (>= 1.2.0) -> Microsoft.Azure.Management.ResourceManager.Fluent (>= 1.2.0) -> Microsoft.Rest.ClientRuntime.Azure.Authentication (>= 2.3.1) -> Microsoft.IdentityModel.Clients.ActiveDirectory (>= 3.13.9)。

知道如何解决这个问题吗?

【问题讨论】:

  • 你试过Reference the package directly from the project to resolve this issue吗?
  • @KirkLarkin -> 我尝试将 Nuget 包添加到项目中:ProjectX.Auth.Web = Microsoft.IdentityModel.Clients.ActiveDirectory (>= 3.14.1) 和 ProjectX.Shared.ServiceBus -> Microsoft.IdentityModel.Clients.ActiveDirectory (>= 3.13.9)。如果这就是你的意思?
  • @RuneJensen 为依赖链中的所有 ProjectX. 项目尝试 install-package Microsoft.IdentityModel.Clients.ActiveDirectory - 这将包括 ProjectX.Auth.Infrastructure 和 ProjectX.Shared.Infrastructure
  • @KirkLarkin -> 将包添加到整个依赖链中的工作接缝。

标签: c# asp.net-core azureservicebus


【解决方案1】:

您可以添加 binding redirect 以重定向到最新版本的 Microsoft.IdentityModel.Clients.ActiveDirectory (3.14.1)。

或者,您也可以auto-generate binding redirects。

 <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

 <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

【讨论】:

  • 我尝试将您的自动生成建议添加到依赖链中的所有 .csproj 文件中。但我遇到了同样的错误。
【解决方案2】:

我使用@KirkLarkin的问题cmets中提出的方法,并在整个依赖链中添加了NuGet包。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-10-30
    • 1970-01-01
    • 2021-05-14
    • 1970-01-01
    • 1970-01-01
    • 2020-05-02
    • 2019-05-31
    • 2019-08-07
    相关资源
    最近更新 更多