升级 Newtonsoft.JSON 是不是存在任何已知的向后兼容性问题?
Posted
技术标签:
【中文标题】升级 Newtonsoft.JSON 是不是存在任何已知的向后兼容性问题?【英文标题】:Are there any known backward compatibility issues with upgrading Newtonsoft.JSON?升级 Newtonsoft.JSON 是否存在任何已知的向后兼容性问题? 【发布时间】:2015-05-15 03:15:37 【问题描述】:升级 Newtonsoft.JSON 是否存在任何已知的向后兼容性问题,特别是在我的情况下从 4.5.9 升级到 6.0.8?
【问题讨论】:
我在一个使用 web api 1 的客户端应用程序上工作,该应用程序依赖于 newtonsoft.json 4.x,我们升级到 web api 2,它依赖于 newtonsoft json 的 v6.0.5,没有看到任何问题。被序列化/反序列化的对象相当简单。 如果您从james.newtonking.com 开始并返回页面,您将能够找到所有更改。 (我建议你回到 4.5.8 版并从那里继续工作。) 我已经成功地将多个项目从 6.x 升级到 10.x 没有问题。 【参考方案1】:我没有发现任何与我的不兼容问题。我已经将我的从 v5.0.8 升级到 v6.0.8,它工作正常。但是我想只是为您检查 v4.5.9 的更改,因为我也很好奇。
所以,这里是从 v4.5.9 到 v6.0.8 所做的更改列表。
v4.5.10
Change - Improved duplicate object reference id error message
v4.5.11
Change - Silverlight and Windows Phone assemblies in NuGet are strong named again
Change - Improved CamelCasePropertyNamesContractResolver camel casing property names
Change – Explicit JValue conversions are more flexible when converting values
v5.0.1
Change - NaN and Infinity floating point values are serialized as strings by default
Change - Minor breaking changes to JsonSchema type
Change - Upgraded Windows Phone assembly to WP8
Change - DateTime IDictionary keys are now serialized in ISO date format
Change - DataContractAttribute is no longer inherited to match DataConctractSerializer behavior
Change - StringEnumConverter converts empty strings to null for nullable enums
Change - Guids serialize to a binary UUID in BSON instead of a string
Remove - Removed SL4 library
Remove - Removed WP7 library
v5.0.2
Remove - Removed WP8 library
v5.0.3
(Fix)
v5.0.4
Change - Changed .NET 4.5 portable library and WinRT library to use compiled expressions reflection
v5.0.5
Change - Changed some explicit interface methods on JArray to public to support use with ImpromtuInterface
v5.0.6
(New features and fixes)
v5.0.7
Change - Extension data is now written when serializing
v5.0.8
(Fix)
v6.0.1
Change - Changed assembly version to 6.0.0.0
Change - .NET 4 Portable build targets MonoTouch and MonoDroid in NuGet package
Change - .NET 4 Portable build targets WP8 and SL5 instead of WP7 and SL4
Removed - DefaultMemberSearchFlags on DefaultContractResolver is obsolete
Removed - SerializeObjectAsync, DeserializeObjectAsync, PopulateObjectAsync on JsonConvert are obsolete
v6.0.2
(New feature)
v6.0.3
Change - Blank XML elements will be written as an empty string instead of null
Change - JValue with a null value will be written as null instead of empty string
Change - DateFormatString is now used when reading JSON
v6.0.4
Change - Limited integer parsing size to javascript integer size
Change - Validation that numbers don't end with an invalid character
v6.0.5
(New features and fixes)
v6.0.6
Change - Omit fields array for F# discriminated union serialization when there are no fields
Change - Escape property names in path on readers/writers/tokens when a name contains special characters
Change - Provide line numbers for end tokens on JTokenReader
v6.0.7
(New features and fixes)
v6.0.8
(New feature and fixes)
我希望这篇文章可以帮助其他正在决定升级或不升级的人。
干杯, 山姆
【讨论】:
以上是关于升级 Newtonsoft.JSON 是不是存在任何已知的向后兼容性问题?的主要内容,如果未能解决你的问题,请参考以下文章
无法加载文件或程序集'Newtonsoft.Json,版本 = 10.0.0.0' - 但是 bin 文件夹中存在二进制文件
Newtonsoft.Json v11 - DeserializeObject抛出JsonReaderException
在Asp.Net Core 3.0中如何使用 Newtonsoft.Json 库序列化数据
未能加载文件或程序集“Newtonsoft.Json, Version=4.5.0.0, Culture=neutral,解决