Dmitrii Kurylev
Dmitrii Kurylev

Reputation: 437

Can I Skip linking assemblies in UWP Project?

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

Answers (1)

Nico Zhu
Nico Zhu

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] or JsonConverter(typeof(MyClass))] in MyClass description. It will work correctly.

Upvotes: 1

Related Questions