Forum Libraries, Components, and Plugins

Newtonsoft SerializeObject gives {}

When I try to serialize object to json using newtonsoft json converter then I get "{}". I am testing it on android device.
My code is

  LoginRequest objLoginRequest = new LoginRequest();
  objLoginRequest.CompName = CompName;
  objLoginRequest.Usercode = Usercode;
  objLoginRequest.Password = Password;
  objLoginRequest.DeviceToken = "test";

 string jsonRequest = JsonConvert.SerializeObject(objLoginRequest);       


  • prashantvcprashantvc USXamarin Team Xamurai

    That's rather strange! Could you share the LoginRequest code?

        public class LoginRequest
            public string CompName { get; set; }
            public string Usercode { get; set; }
            public string Password { get; set; }
            public string DeviceToken { get; set; }

    This works well in emulator but gives "{}" in Xamarin Live Player

  • segusoseguso Member

    same problem here...

Sign In or Register to comment.