2

Assuming we have .Net solution which contains multiple projects, one of these projects references a Nuget package A

(4.0.0 for example and this is the latest version of the package)

that references Newtonsoft.Json (9.0.1) for example, but doesn't figure as a dependency of the Nuget A.

I am not satisfied that project A is referencing that version (9.0.1) of Newtonsoft, and my question is there any solution to override the dependency of my Nuget A and force it to use Newtonsoft 13.0.1 for example?

I'm using packages.lock.json files and I reference my Nuget as PackageReference.

Mselmi Ali
  • 1,139
  • 2
  • 18
  • 28

1 Answers1

1

I may be reading the question wrong, but:

For override, you'd just want to add Newtonsoft.Json 13.0.1 to the top-level project and that would override the package version even if your referenced project has a lower-level package. Override would only happen of course when running your top-level project that has that higher-version reference.

An override that moves up that many versions would likely break, though.

Whaaa
  • 73
  • 4