程序集版本冲突(Microsoft.Data.Services.Client)

时间:2017-03-24 13:51:04

标签: .net compiler-errors .net-assembly

在下面使用Framework 4.6.1运行的ASP.NET Core 1.1.1 MVC 6项目中使用Microsoft.Azure.ActiveDirectory.GraphClient 2.1.1。它是Microsoft.Data.Services.Client中的一个依赖项。然而,当我编译时,我得到了一个似乎是在早期版本中引用自身的程序集!

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

我还尝试使用app.config进行程序集绑定重定向(因为它是一个Core项目),但我一直得到同样的错误。我该如何解决这个问题?

<?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>

我已经搜索了我的整个项目以获得对5.6.4.0的参考而没有运气。

0 个答案:

没有答案