JsonConvert.SerializeObject always return {} in XamarinForms

后端 未结 2 1995
渐次进展
渐次进展 2020-11-27 08:34

JsonConvert.SerializeObject seems to be not working in xamarin forms. Or i might be missing something here. Here is the output when i serialize a simple object.

See

相关标签:
2条回答
  • 2020-11-27 08:40

    This is a known problem see https://developer.xamarin.com/guides/cross-platform/live/limitations/

    Limited support for reflection (currently affects some popular NuGets, like SQLite and Json.NET). Other NuGets are still supported.

    If you compile it to an APK it works fine on the actual device.

    Also posted an issue here: https://github.com/JamesNK/Newtonsoft.Json/issues/1578

    0 讨论(0)
  • 2020-11-27 08:53

    I tried setting up emulator on a fast machine and the serialize works! So it means it doesn't work when i run it on live player using my android phone. I will set this as an answer for now. if someone else posted on how to make it work on live player, i will set it as the correct answer

    0 讨论(0)
提交回复
热议问题