3
votes

I'am getting this error when trying to use Microsoft.Azure.Management.Fluent in my project.

Severity Code Project Description File Line Suppression State Error NU1607 ProjectX.Auth.Web Version conflict detected for Microsoft.IdentityModel.Clients.ActiveDirectory. Reference the package directly from the project to resolve this issue.

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).

Any idea how to solve this ?

2
Have you tried to Reference the package directly from the project to resolve this issue?Kirk Larkin
@KirkLarkin -> I tried to add Nuget packages to the projects: ProjectX.Auth.Web = Microsoft.IdentityModel.Clients.ActiveDirectory (>= 3.14.1) and ProjectX.Shared.ServiceBus -> Microsoft.IdentityModel.Clients.ActiveDirectory (>= 3.13.9). If thats what you mean?Rune Jensen
@RuneJensen try install-package Microsoft.IdentityModel.Clients.ActiveDirectory for all ProjectX. projects in the dependency chain - that would include ProjectX.Auth.Infrastructure and ProjectX.Shared.Infrastructurevzwick
@KirkLarkin -> It seams to work adding the packages to the entire dependency chain.Rune Jensen

2 Answers

1
votes

You could add a binding redirect to redirect to the latest version of Microsoft.IdentityModel.Clients.ActiveDirectory (3.14.1).

Alternatively, you can also auto-generate binding redirects.

 <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

 <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
1
votes

I used the method proposed in the question comments by @KirkLarkin and added the NuGet packages in the entire dependency chain.