xamarin - JsonConvert.DeserializeObjects does not work after Linking SDK and User Assemblies -
the method jsonconvert.deserializeobjects works when linking set sdk assemblies when build project using link sdk , user assemblies option in linker properties, not work, returns null in fields of deserialized object.
you need put [preserve(allmembers = true)]
attribute on classes dynamically generated. prevent them being stripped out.
you can read more on ios linker here.
so lets have list of users want deserialize like.
var user = jsonconvert.deserializeobject<user>(json);
in user class want place attribute on class.
[preserve(allmembers = true)] public class user{ public string email { get; set; } public string firstname { get; set; } public string lastname { get; set; } }
Comments
Post a Comment