Skip to content

Upgrading Newtonsoft.Json 12 to 13

Breaking12.0.3 → 13.0.4Breaking2Security1New7Changed4Fixed22

BreakingUpgrade verdict

2 breaking changes and a security fix.

  • The package no longer ships the old portable class library builds, so projects targeting those profiles must move to a supported target.
  • Code that caught InvalidCastException for a wrong token type must now catch JsonSerializationException.
  • Improper Handling of Exceptional Conditions in Newtonsoft.Json
3 items need code or config changes

Target frameworks requirement changed in 13.0.2-beta1: .NETFramework2.0, .NETFramework3.5, .NETFramework4.0, .NETFramework4.5, .NETPortable0.0-Profile259, .NETPortable0.0-Profile328, .NETStandard1.0, .NETStandard1.3, .NETStandard2.0 → .NETFramework2.0, .NETFramework3.5, .NETFramework4.0, .NETFramework4.5, .NETStandard1.0, .NETStandard1.3, .NETStandard2.0, net6.0.

Breaking2
Removes portable assemblies from the NuGet package.
Throws JsonSerializationException instead of InvalidCastException on mismatched JToken.
JsonSerializationExceptionInvalidCastExceptionJToken
Security1
Improper Handling of Exceptional Conditions in Newtonsoft.Json
High · CVSS 7.5