1

I have a NuGet package that references Newtonsoft.Json v 12.0.2. I can't access the source to that NuGet package. (Technically, NuGet Package Explorer stats that it's really >= 12.0.2 )

If I wish for that package to leverage Newtonsoft.Json v 12.0.3, is it as simple as me "installing" v 12.0.3 into my project and all dependants (and their children, etc) which are using v 12.0.2 will now be magically using my installed 12.0.3 version?

Or does each dependency only use the version explicitly defined in their package?

What is this called? explicit referencing?

Other Info: This is for .NET Core 3.1

Community
  • 1
  • 1
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647

1 Answers1

2

For the new sdk project, when you install a nuget package, it will install its lowest dependencies on your project and if you want to use the higher version, you only need to install the updated dependency nuget package separately and then it will update all the dependencies to the updated version.

And it will update all dependencies of your project to that version. Note that it will not act on a single nuget package but all.

These two nuget packages used Newtonsoft.Json 12.0.2 dependency

enter image description here

And if I install Newtonsoft.Json 12.0.3 nuget package separately:

enter image description here

They all used Newtonsoft.Json 12.0.3 and it proves that they are Shared rather than using a separate version.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41