7
votes

I'm getting an annoying MSB3277 warning when I build my project. I increased verbosity to "detailed" and I was able to get the following information from the log:

      There was a conflict between "Pathoschild.Http.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" and "Pathoschild.Http.Client, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null".
         "Pathoschild.Http.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" was chosen because it was primary and "Pathoschild.Http.Client, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null" was not.

         References which depend on "Pathoschild.Http.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" [C:\Users\desau\.nuget\packages\pathoschild.http.fluentclient\3.0.0\lib\netstandard1.3\Pathoschild.Http.Client.dll].
             C:\Users\desau\.nuget\packages\pathoschild.http.fluentclient\3.0.0\lib\netstandard1.3\Pathoschild.Http.Client.dll
               Project file item includes which caused reference "C:\Users\desau\.nuget\packages\pathoschild.http.fluentclient\3.0.0\lib\netstandard1.3\Pathoschild.Http.Client.dll".
                 C:\Users\desau\.nuget\packages\pathoschild.http.fluentclient\3.0.0\lib\netstandard1.3\Pathoschild.Http.Client.dll

         References which depend on "Pathoschild.Http.Client, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null" [].
             C:\Users\desau\.nuget\packages\stronggrid\0.30.0\lib\netstandard1.3\StrongGrid.dll
               Project file item includes which caused reference "C:\Users\desau\.nuget\packages\stronggrid\0.30.0\lib\netstandard1.3\StrongGrid.dll".
                 C:\Users\desau\.nuget\packages\stronggrid\0.30.0\lib\netstandard1.3\StrongGrid.dll

If I understand this log correctly, it's telling me that my project references Pathoschild.Http.Client version 3.0 and also version 3.1. I understand the reference to version 3.1 because my project references a nuget package called StrongGrid which itself references Pathoschild version 3.1

But I fail to understand where the reference to version 3.0 comes from.

I'm using Visual Studio 2017 and MSBuild 15 in case that's helpful information.

1
Are you using VS 2017 version 15.3 and the .NET Core SDK 2.0.0? (released in august) - they should contain the necessary conflict resolution logicMartin Ullrich
VS 2017 Version 15.3.5 and when building from command prompt, it simply says Building with tools version "15.0"desautelsj
Running dotnet --info: .NET Command Line Tools (2.0.0)desautelsj
Sorry I just read Http.Client and thought It was the recurring issue of netstasndard libs at the moment. This is a different library and two NuGet packages depending on different versions of the same assembly.Martin Ullrich
As far as I know, I am only referencing one nuget package which references Pathoschild.Http.Client version 3.1 I don't see where the reference to version 3.0 is and the log doesn't name the second package (unless I'm not reading the log correctly).desautelsj

1 Answers

5
votes

The reason for this issue is that the StrongGrid package is authored incorrectly.

The version 0.30 of StrongGrid is built against version 3.1.0 of Pathoschild.Http.FluentClient, but their .nuspec file used for creating the NuGet package still lists version 3.0.0 as dependency, so the consuming project will fetch an older version, creating a conflict that cannot be resolved.

To work around this problem, you can explicitly reference version 3.1.0 of Pathoschild.Http.FluentClient by adding a package reference to the csproj file to override the version.