0

I am trying to install a package (produced internally) and get a "weird" conflict.

It's weird because the conflict is coming from the same installed package (not two different installed packages).

Nuget is essentially reporting that "YadaYada.Amazon.Api 20.340.63" requires two conflicting versions of "Microsoft.AspNetCore.JsonPatch".

I have tried adding either of the versions explicitly to "YadaYada.Amazon.Api" and it does not help.

Please advise how to get around this issue?

Install-Package : NU1107: Version conflict detected for Microsoft.AspNetCore.JsonPatch. Install/reference Microsoft.AspNetCore.JsonPatch 3.1.10 directly to project BubbleBoy.AutoParts.Deploy to resolve this issue. 
 BubbleBoy.AutoParts.Deploy -> YadaYada.Amazon.Api 20.340.634 -> Microsoft.AspNetCore.Mvc.NewtonsoftJson 3.1.10 -> Microsoft.AspNetCore.JsonPatch (>= 3.1.10) 
 BubbleBoy.AutoParts.Deploy -> YadaYada.Amazon.Api 20.340.634 -> Microsoft.AspNetCore.App 2.1.0 -> Microsoft.AspNetCore.JsonPatch (= 2.1.0).
David Makogon
  • 69,407
  • 21
  • 141
  • 189
Tim Bassett
  • 1,325
  • 1
  • 12
  • 23
  • See this:https://stackoverflow.com/questions/50373073/resolve-nuget-version-conflict and this https://michaelscodingspot.com/how-to-resolve-net-reference-and-nuget-package-version-conflicts/ – I_Al-thamary Dec 05 '20 at 17:48
  • I don't think this is a nuget conflict version per se. This is package version issue – bre_dev Dec 05 '20 at 17:50
  • @bre_dev the problem is that there are different applications store different versions of the same DLL and the different applications will load their intended version. – I_Al-thamary Dec 05 '20 at 17:53
  • Exactly. @i_thamary, that's why I said that it is not nuget version installed issue, the conflict is happening at package versions level. – bre_dev Dec 05 '20 at 17:55
  • @bre_dev there are differents suggestions and some of the solutions need his trying to see what will work as this problem https://github.com/dotnet/sdk/issues/2253. – I_Al-thamary Dec 05 '20 at 17:59

2 Answers2

1

The BubbleBoy.AutoParts.Deploy package definition is broken, it references two different ASP.NET Core packages.

Modify that project to update all dependencies to a compatible version, and release a new version.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
  • 1
    I was using a mix of csproj and nuspec and had enterred the Json ref based on a previously generated nuspec. The version had changed. Thankx – Tim Bassett Dec 05 '20 at 20:29
0

I would suggest uninstall the conflicting packages completely. Also, if you have other projects in your solution which are referenced in your broken project or that your proj refereces, and that are using these conflicting libraries, uninstall from these as well.

Once the only error you see in your solution is about the missing package you uninstalled, go and install the version you need.

This kind of issues comes up when you have multiple projects referenced together which are using packages not compatible with one another.

bre_dev
  • 562
  • 3
  • 21