【发布时间】:2020-07-20 15:18:47
【问题描述】:
在 WASM (#uno-platform) 中使用 .Net Standard 2.0 Nuget(直接链接项目的相同问题)时遇到问题:
反序列化需要一个无参数构造函数(Microsoft 和 Newtonsoft 反序列化器)。
显然,所涉及的类具有无参数构造函数,并且 Nuget 在 UWP、WPF 和 Xamarin 项目中运行良好:
public class MCEFile
{
public List<Form> Forms { get; set; }
public List<Item> Items { get; set; }
[JsonConstructor]
public MCEFile()
{
Forms = new List<Form>();
Items = new List<Item>();
}
}
public class Item
{
public long ID { get; set; }
...
// - - - - - -
[JsonConstructor]
public Item()
{
// dummy for WASM
}
}
有什么线索吗?有解决方案或解决方法吗?或者我可以关注的问题?
问候, 迈克尔
【问题讨论】: