Reputation: 437
I use xamarin forms. I have problem with "Newtonsoft.Json.JsonConvert.DeserializeObject" NullReferenceException crash on Xamarin.UWP only in Release mode (in Debug work, but in Release not). I saw, that I can add System.Core;System.Runtime.Serialization to the Skip linking assemblies to fix it. In Android Project I found this menu, but in UWP project not. What can I do?
Upvotes: 0
Views: 185
Reputation: 32775
I have edited @Dmitrii Kurylev's comment as the answer. if other users who come cross this issue, please reference following reply.
Solution is simple do not use json converter when you use the following code .it give null reference exeption on UWP in release mode.
DeserializeObject<List<MyClass>>(content, new MyJsonConverter());
For right work you should use
DeserializeObject<List<MyClass>>(content)
And if you want to use
converter
you can use attribute[JsonConstructor]
orJsonConverter(typeof(MyClass))]
inMyClass
description. It will work correctly.
Upvotes: 1