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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -