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

Popular posts from this blog

ruby on rails - Permission denied @ sys_fail2 - (D:/RoR/projects/grp/public/uploads/ -

c++ - nodejs socket.io closes connection before upgrading to websocket -

java - What is the equivalent of @Value in CDI world? -