我正在创建一个asp.net 2.0 webservice,它将json作为输出,并且有一个非常大的,不能分解,超出最大长度限制的数据集
我在互联网上搜索,有.net 3.5和4的解决方案,但不是2.0。
可以告诉我如何增加JSON限制?
我正在创建一个asp.net 2.0 webservice,它将json作为输出,并且有一个非常大的,不能分解,超出最大长度限制的数据集
我在互联网上搜索,有.net 3.5和4的解决方案,但不是2.0。
可以告诉我如何增加JSON限制?
我有同样的问题。看到3.5和4.0解决方案感到沮丧。结果你做同样的事情,你只需要添加几行 <ConfigSections>
Web.config中的标记。粘贴它时它应该是根下的第一个元素。
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
然后添加实际 <system.web.extensions>
部分:
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="50000000"/>
</webServices>
</scripting>
</system.web.extensions>