Newtonsoft.JSON serializeobject returns empty JSON string [duplicate] Newtonsoft.JSON serializeobject returns empty JSON string [duplicate] json json

Newtonsoft.JSON serializeobject returns empty JSON string [duplicate]


Your question is a little misleading since you show your class properties as public.

Also, I noticed that although my Customer class is public, its members are non-public:

WIth that being said these are your options:

  1. If your properties can be public, make them public
  2. If the properties need to remain private, add the [JsonProperty] attribute to them


It appears that Xamarin Live Player has some issues with the serializer. I tried plugging my phone via USB and it works!