Why is Newtonsoft.Json so prone to build version conflicts?

I noticed that we often get assembly conflicts in our project, and in 90% of cases this is Newtonsoft.Json below. There are many questions about SO specifically for conflicts Newtonsoft.Json - the infamous "Could not load file or assembly" Newtonsoft.Json, Version = 6.0.0.0 ", for example. Searching for the " collection "Newtonsoft.Json, Version = 6.0.0.0" gives 37 questions - many of them are very highly rated. Or it's about 4.5.0.0 .

Are there any explanations why this often happens with this library, and not with others, and why there is such a consistent source of assembly version conflicts? This definitely happens more often than with other libraries.

+4
source share
1 answer

Why is Newtonsoft.Json so prone to build version conflicts?

In principle, since it is commonly used as a downstream dependency by other libraries and application code. If you have a package A(in this case Netwonsoft.Json), and you have:

SomeApp
-> A

then everything is fine; but if you have:

SomeApp
-> A
-> SomeLib
   -> A

or

SomeApp
-> SomeLib
   -> A
-> SomeOtherLib
   -> A

or

SomeApp
-> A
-> SomeLib
   -> A
-> SomeOtherLib
   -> A

or

SomeApp
-> A
-> SomeLib
   -> A
-> SomeOtherLib
   -> YetAnotherLib
      -> A
      -> MeTooLib
         -> A

A , , lib, 7, 10 . , , API , 7 10 , .

, : , , . Json.NET , , , , .

, NuGet .

+8

Source: https://habr.com/ru/post/1679712/


All Articles