1

Using Microsoft.Azure.ActiveDirectory.GraphClient 2.1.1 in an ASP.NET Core 1.1.1 MVC 6 project running with Framework 4.6.1 underneath. One of it's dependencies in Microsoft.Data.Services.Client. However when I compile I get what seems to be the assembly referencing itself in an earlier incarnation!

1>    There was a conflict between "Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "Microsoft.Data.Services.Client, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
1>        "Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "Microsoft.Data.Services.Client, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
1>        References which depend on "Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Users\Steve\.nuget\packages\microsoft.data.services.client\5.6.4\lib\net40\Microsoft.Data.Services.Client.dll].
1>            C:\Users\Steve\.nuget\packages\microsoft.data.services.client\5.6.4\lib\net40\Microsoft.Data.Services.Client.dll
1>              Project file item includes which caused reference "C:\Users\Steve\.nuget\packages\microsoft.data.services.client\5.6.4\lib\net40\Microsoft.Data.Services.Client.dll".
1>                C:\Users\Steve\.nuget\packages\microsoft.data.services.client\5.6.4\lib\net40\Microsoft.Data.Services.Client.dll
1>        References which depend on "Microsoft.Data.Services.Client, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Users\Steve\Source\Repos\Platform\MyProject.Domain\bin\Debug\Microsoft.Data.Services.Client.dll].
1>            C:\Users\Steve\.nuget\packages\microsoft.azure.activedirectory.graphclient\2.1.1\lib\portable-net4+sl5+win+wpa+wp8\Microsoft.Azure.ActiveDirectory.GraphClient.dll
1>              Project file item includes which caused reference "C:\Users\Steve\.nuget\packages\microsoft.azure.activedirectory.graphclient\2.1.1\lib\portable-net4+sl5+win+wpa+wp8\Microsoft.Azure.ActiveDirectory.GraphClient.dll".
1>                C:\Users\Steve\Source\Repos\Platform\MyProject.Domain\bin\Debug\MyProject.Domain.dll
1>                C:\Users\Steve\.nuget\packages\microsoft.azure.activedirectory.graphclient\2.1.1\lib\portable-net4+sl5+win+wpa+wp8\Microsoft.Azure.ActiveDirectory.GraphClient.dll
1>            C:\Users\Steve\Source\Repos\Platform\MyProject.StorageServices\bin\Debug\Microsoft.WindowsAzure.Storage.dll
1>              Project file item includes which caused reference "C:\Users\Steve\Source\Repos\Platform\MyProject.StorageServices\bin\Debug\Microsoft.WindowsAzure.Storage.dll".
1>                C:\Users\Steve\Source\Repos\Platform\MyProject.StorageServices\bin\Debug\MyProject.StorageServices.dll
1>                C:\Users\Steve\Source\Repos\Platform\MyProject.Domain\bin\Debug\MyProject.Domain.dll
1>            C:\Users\Steve\Source\Repos\Platform\MyProject.Domain\bin\Debug\MyProject.Domain.dll
1>              Project file item includes which caused reference "C:\Users\Steve\Source\Repos\Platform\MyProject.Domain\bin\Debug\MyProject.Domain.dll".
1>                C:\Users\Steve\Source\Repos\Platform\MyProject.Domain\bin\Debug\MyProject.Domain.dll

I also attempted an assembly binding redirect using app.config (as it's a Core project) but I keep getting the same error. How do I resolve this?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <dependentAssembly>
      <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-5.8.1.0" newVersion="5.8.1.0" />
    </dependentAssembly>
  </runtime>
</configuration>

I have searched my entire project for a reference to 5.6.4.0 with no luck.

RNDThoughts
  • 892
  • 3
  • 13
  • 30
  • Did you try to reinstall that nuget package? Nuget link: https://www.nuget.org/packages/Microsoft.Data.Services.Client/ – Ognjen Babic Mar 29 '17 at 08:18
  • Did you put that bindingRedirect into your main project's config or any other library's config (some libraries may have their own app.configs but they are not used by the compiler and host)? That bindingRedirect had to work imo.. – yakya Mar 31 '17 at 14:01
  • And by any chance, did you give any direct reference to 5.6.4 in one of your projects? Because it says 5.6.4 is "primary" and msbuild tries to "guess" which one it should use. But even if you gave 5.6.4's reference, that bindingRedirect had to work.. – yakya Mar 31 '17 at 14:03
  • I double checked all references, and none of them were pointing to 5.6.4. In the end I ended up cleaning the entire project, completely removing all the nuget packages in every project involved and re-adding them one by one paying careful attention to any upgrade that happened as a result of a dependency. Somehow this resolved it but by god it was painful... – RNDThoughts Apr 03 '17 at 10:58

0 Answers0