using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
public static void Test()
var def = Activator.CreateInstance(t);
Console.WriteLine(def.GetType());
string json = "18446744073709551615";
object parsedObject1 = JsonConvert.DeserializeAnonymousType(json, def);
Console.WriteLine(parsedObject1.GetType());
object parsedObject = JsonConvert.DeserializeObject(json, def.GetType());
Console.WriteLine(parsedObject.GetType());
public static void Main()
Console.WriteLine("Environment version: " + Environment.Version);
Console.WriteLine("Json.NET version: " + typeof(JsonSerializer).Assembly.FullName);
Console.WriteLine("Failed with unhandled exception: ");