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 settings = new JsonSerializerSettings
FloatParseHandling = FloatParseHandling.Decimal,
var json = JsonConvert.SerializeObject(decimal.MaxValue, settings);
var dec = JsonConvert.DeserializeObject<JToken>(json, settings);
Console.WriteLine(json2);
var dec2 = JsonConvert.DeserializeObject<JToken>(json2, settings);
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: ");