Skip to content

Upgrading Newtonsoft.Json 3 to 4

Breaking3.5.8 → 4.5.11Breaking6Security2New88Changed35Fixed114Other2

BreakingUpgrade verdict

6 breaking changes and 2 security fixes.

  • Two internal type-description helper types are no longer available.
  • Code that catches the general Exception type may need to catch the new specific type instead.
  • The setting that controls the culture used when reading values now lives on the base reader class instead of the text reader class.
  • Code that uses JPropertyDescriptor must update its using statements.
Top 5 of 8 that need code or config changes
Breaking6
Removes JTypeDescriptionProvider and JTypeDesciptor.
JTypeDescriptionProviderJTypeDesciptor
Changes instances of Exception to be a more specific exception.
Exception
Moves the Culture property from JsonTextReader to JsonReader.
JsonTextReader.CultureJsonReader.Culture
Moves JPropertyDescriptor to the Newtonsoft.Json.Linq namespace.
JPropertyDescriptorNewtonsoft.Json.Linq
Replaces JSON schema Required with Optional, as defined in JSON schema spec 3.
RequiredOptional
Replaces JSON schema MaxDecimals with DivisibleBy, as defined in JSON schema spec 3.
MaxDecimalsDivisibleBy
Security2
Adds SecurityTransparent attribute to the WinRT build.
SecurityTransparent
Serializing ISerializable types under partial trust now errors to fix a potential security issue.
ISerializable