JSON.NET - How do I include Type Name Handling for primitive C# types that are stored in an array/list as Object type
问题 I am using Newtonsoft JSON.NET to serialize/deserialize stuff for me. But I have this list wherein they are of Object type: var list = new List<Object>() { "hi there", 1, 2.33 }; When I serialize that with TypeNameHandling set to TypeNameHandling.All , I was expecting that it will also give a $type for each instance on the list but doesn't seem to be the case. Here is the actual output: { "$type": "System.Collections.Generic.List`1[[System.Object, mscorlib]], mscorlib", "$values": [ "hi there