Json 文件中有大约 5000 个条目。我使用方法JavaScriptSerializer.Deserialize<T>
(字符串),但出现以下错误:
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.ThrowIfMaxJsonDeserializerMembersExceeded(Int32 count)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)
at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)
at xxx.Internet.Core.Services.xxxService.DeserializeAtms(String xxxJson, List`1& xxxList)
at xxx.Internet.Jobs.xxxFetcherJob.xxxFetcherJob.Execute(Guid contentDbId)
我试着在 web.config 中写:
<appSettings>
<add key="aspnet:MaxJsonDeserializerMembers" value="150000" />
</appSettings>
但它没有帮助......