none
Version conflict detected for Microsoft.IdentityModel.Clients.ActiveDirectory RRS feed

  • Question

  • Creating an Azure function that uses nuget packages Microsoft.Rest.ClientRuntime.Azure.Authentication for authenticating to DataLake as well as Microsoft.IdentityModel.Clients.ActiveDirectory for authenticating to HDInsight. Getting the following error when I try to install both in the function project:

    uninstall-package : Version conflict detected for Microsoft.IdentityModel.Clients.ActiveDirectory. Reference the package directly from the project to resolve this issue. MyProject.Functions (>= 1.0.0) -> Microsoft.Rest.ClientRuntime.Azure.Authentication (>= 2.3.1) -> Microsoft.IdentityModel.Clients.ActiveDirectory (>= 2.28.3) MyProject.Functions (>= 1.0.0) -> Microsoft.Azure.Common.Authentication (>= 1.7.0-preview) -> Microsoft.IdentityModel.Clients.ActiveDirectory (>=2.18.206251556).

    It looks like Microsoft.Azure.Common.Authentication 1.7.0-preview has a constraint on referencing Microsoft.IdentityModel.Clients.ActiveDirectory 2.18.206251556 only. Unfortunately this library has not been updated since February 2016 and I'm not sure of another way of authenticating non-interactively with HDInsight besides the steps outlined at https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-create-non-interactive-authentication-dotnet-applications

    Thursday, November 9, 2017 3:07 AM

All replies

  • Creating an Azure function that uses nuget packages Microsoft.Rest.ClientRuntime.Azure.Authentication for authenticating to DataLake as well as Microsoft.IdentityModel.Clients.ActiveDirectory for authenticating to HDInsight. Getting the following error when I try to install both in the function project:

    install-package : Version conflict detected for Microsoft.IdentityModel.Clients.ActiveDirectory. Reference the package directly from the project to resolve this issue. MyProject.Functions (>= 1.0.0) -> Microsoft.Rest.ClientRuntime.Azure.Authentication (>= 2.3.1) -> Microsoft.IdentityModel.Clients.ActiveDirectory (>= 2.28.3) MyProject.Functions (>= 1.0.0) -> Microsoft.Azure.Common.Authentication (>= 1.7.0-preview) -> Microsoft.IdentityModel.Clients.ActiveDirectory (>=2.18.206251556).

    It looks like Microsoft.Azure.Common.Authentication 1.7.0-preview has a constraint on referencing Microsoft.IdentityModel.Clients.ActiveDirectory 2.18.206251556 only. Unfortunately this library has not been updated since February 2016 and I'm not sure of another way of authenticating non-interactively with HDInsight besides the steps outlined at https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-create-non-interactive-authentication-dotnet-applications


    Thursday, November 9, 2017 3:06 AM
  • Try adding an explicit reference to Microsoft.IdentityModel.Clients.ActiveDirectory, 2.28.3 in your .csproj file. I think this error message is basically asking you to choose which of the two versions you want to use since your dependencies are asking for different versions.
    Thursday, November 9, 2017 4:50 AM
  • That seems to have fixed the version mismatch, however after removing all references to Microsoft.IdentityModel.Clients.ActiveDirectory 2.18.0.0, the Microsoft.Azure.Common.Authentication 1.7.0.0 assembly still insists on using that version.

    From the Fusion log:

    === Pre-bind state information ===
    LOG: DisplayName = Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.18.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
     (Fully-specified)
    LOG: Appbase = file:///C:/Users/Paul/AppData/Local/Azure.Functions.Cli/1.0.6/
    LOG: Initial PrivatePath = NULL
    Calling assembly : Microsoft.Azure.Common.Authentication, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
    ===
    LOG: This bind starts in LoadFrom load context.
    WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
    LOG: Using application configuration file: C:\Users\Paul\AppData\Local\Azure.Functions.Cli\1.0.6\func.exe.Config
    LOG: Using host configuration file:
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Post-policy reference: Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.18.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
    LOG: Attempting download of new URL file:///C:/Users/Paul/AppData/Local/Azure.Functions.Cli/1.0.6/Microsoft.IdentityModel.Clients.ActiveDirectory.DLL.
    WRN: Comparing the assembly name resulted in the mismatch: Minor Version
    LOG: Attempting download of new URL file:///C:/Users/Paul/AppData/Local/Azure.Functions.Cli/1.0.6/Microsoft.IdentityModel.Clients.ActiveDirectory/Microsoft.IdentityModel.Clients.ActiveDirectory.DLL.
    LOG: Attempting download of new URL file:///C:/Users/Paul/AppData/Local/Azure.Functions.Cli/1.0.6/Microsoft.IdentityModel.Clients.ActiveDirectory.EXE.
    LOG: Attempting download of new URL file:///C:/Users/Paul/AppData/Local/Azure.Functions.Cli/1.0.6/Microsoft.IdentityModel.Clients.ActiveDirectory/Microsoft.IdentityModel.Clients.ActiveDirectory.EXE.
    LOG: Attempting download of new URL file:///C:/Users/Paul/Source/Repos/MyProject.Import/MyProject.Functions/bin/Debug/net461/bin/Microsoft.IdentityModel.Clients.ActiveDirectory.DLL.
    WRN: Comparing the assembly name resulted in the mismatch: Minor Version
    LOG: Attempting download of new URL file:///C:/Users/Paul/Source/Repos/MyProject.Import/MyProject.Functions/bin/Debug/net461/bin/Microsoft.IdentityModel.Clients.ActiveDirectory/Microsoft.IdentityModel.Clients.ActiveDirectory.DLL.
    LOG: Attempting download of new URL file:///C:/Users/Paul/Source/Repos/MyProject.Import/MyProject.Functions/bin/Debug/net461/bin/Microsoft.IdentityModel.Clients.ActiveDirectory.EXE.
    LOG: Attempting download of new URL file:///C:/Users/Paul/Source/Repos/MyProject.Import/MyProject.Functions/bin/Debug/net461/bin/Microsoft.IdentityModel.Clients.ActiveDirectory/Microsoft.IdentityModel.Clients.ActiveDirectory.EXE.

    Thursday, November 9, 2017 8:33 PM