using Newtonsoft.Json.Serialization;
public static void Main()
var poco = new Poco { Id = 1, Name = "foo" };
var resolver = new DefaultContractResolver
IgnoreSerializableAttribute = false
var settings = new JsonSerializerSettings
Formatting = Formatting.Indented,
ContractResolver = resolver
string json = JsonConvert.SerializeObject(poco, settings);
public int Id { get; set; }
public string Name { get; set; }