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 string ExceptionJSONString
public static MyResponse ExceptionTest()
MyResponse response = new MyResponse();
response.ExceptionJSONString = Newtonsoft.Json.JsonConvert.SerializeObject(ex);
public static void Main()
MyResponse response = TestClass.ExceptionTest();
Exception ex1 = new Exception();
Console.WriteLine("Got result back now deserialze");
Console.WriteLine(response.ExceptionJSONString);
Newtonsoft.Json.JsonConvert.PopulateObject(response.ExceptionJSONString, ex1);
Console.WriteLine("Failed with unhandled exception: ");