Evaluate replacing JsonConvert serialization
还没有人认领这个 Issue。
评估
调研方向
首先跟踪 Installer 的 savedState 是如何序列化和反序列化的,然后比较 issue 中讨论的 netstandard2.0 serializer 选项,包括 NetDataContractSerializer 和 BinaryFormatter。验证任意 IDictionary 和子 Installer 状态是否可以在不使用 Json.NET 的情况下完成往返;完成的标准是确定一个兼容的替代方案,或记录必须保留该依赖项的原因。
由索引模型根据 Issue 内容生成。
描述
It looks like you're just using JSON.net to serialize IDictionary in savedState and this could be accomplished with built-in serializers that would remove the dependency on JSON.net (so that a different version can be used or just not bring that dependency along with someone using System.Configuration.Install).
I looked at the reference source and the built-in classes use NetDataContractSerializer which can serialize/deserialize arbitrary types in an IDictionary. We don't have that in netstandard2.0. Another possibility is BinaryFormatter, but that requires ISerializable which IDictionary is not. The concrete type is Hashtable in the underlying implementation for installers.
@flamencist thought this approach might work, but it relies on ToString() to put it in a key value store. Since IDictionary (and Hashtable) can hold any object, this doesn't really work. Some objects may not have a sensible ToString() which would end up with the type name in the output, and they can't really be deserialized in this manner.
In the Installer source I looked at, it appeared that it was putting an integer in there for the count of Installers and then saving all the child Installer states (which can be any object since anyone can inherit Installer).
The reason JsonConvert works is that it serializes the type information too. Is it possible to replace it with something we have in netstandard2.0 so that we don't have to bring along a JSON.Net dependency?
- 主要语言
- C#
- 星标
- 26
- 派生
- 12
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
flamencist/Core.System.Configuration.Install 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 30/100
flamencist/Core.System.Configuration.Install#11 · 2 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 20/100
flamencist/Core.System.Configuration.Install#9 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
flamencist/Core.System.Configuration.Install#8 · 3 条评论 ·
查看 flamencist/Core.System.Configuration.Install 的全部 Issue
相似的 Issue
-
type/automation type/tech-debt
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
-
t/bug
难度 2/5 1-3 小时 新手友好度 82/100
-
ci-failure-cause test-failure
难度 2/5 1-3 小时 新手友好度 82/100
-
area:auth FE mvp P3
难度 2/5 1-3 小时 新手友好度 88/100
klasolsson81/jobbliggaren#1788 ·