Web MVCプログラミング:The length of the string exceeds the value set on the maxJsonLength propert


バックグラウンドJSONからフロントに戻ったときに飛び出したミス:
The length of the string exceeds the value set on the maxJsonLength propert
ネット上の解決策はすべてwebです.configにセグメントを追加:
 
    
      
        
      
    
  

でも役に立たなかった
私の解決策は次のとおりです.
public ActionResult Get(DateTime dateFrom, DateTime dateTo)
		{
			DataTable list = GetList(dateFrom, dateTo);
			var salegoodsList = list.AsEnumerable().GroupBy(t => t["Dimension0"]).Select(n =>
				new
				{
					goodsid = n.Key,
					qty = n.Sum(s => s["    "] == "" ? 0 : Convert.ToInt32(s["    "])),
					stock = n.Sum(s => s["  "] == "" ? 0 : Convert.ToInt32(s["  "]))
				});

                       //    ,   JSON   
			System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
			serializer.MaxJsonLength = Int32.MaxValue;

			var retobject = new
			{  salegoodsList = salegoodsList ,
                           dateFrom = dateFrom 
                        }; 
var result = new ContentResult(); 
result.Content = serializer.Serialize(retobject); 
result.ContentType = "application/json"; 
return result;
}