首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法读取配置节'system.web.extensions‘,因为它缺少节声明

无法读取配置节'system.web.extensions‘,因为它缺少节声明
EN

Stack Overflow用户
提问于 2013-11-19 05:25:43
回答 7查看 110.7K关注 0票数 52

当我在Server 2008 32位机器.NET Framework4.0中安装Web应用程序时,我收到了错误(配置部分无法读取,因为它缺少一个节声明)。但它在2008年的r2 64位机上运行得很好。

这是我的webconfig文件信息

代码语言:javascript
复制
<configuration>
<runtime>
    <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="2147483647"/>
      </webServices>
    </scripting>
  </system.web.extensions>
</configuration>

有什么办法消除这个错误吗?

注意事项:我检查了Stack中的所有相关条目,但是没有什么对我有用。

EN

回答 7

Stack Overflow用户

回答已采纳

发布于 2013-11-19 08:41:02

在我的webconfig文件中添加以下配置设置后,问题得到了解决

代码语言:javascript
复制
<configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>

我们可以参考本文获得更多信息:http://www.morgantechspace.com/2013/11/The-configuration-section-system-web-extensions-cannot-be-read-because-it-is-missing-a-section-declaration.html

票数 47
EN

Stack Overflow用户

发布于 2015-04-14 13:03:29

尝试将应用程序池运行时从.net 2.0更改为.net 4.0

票数 77
EN

Stack Overflow用户

发布于 2014-08-16 04:04:08

在将我的操作系统从Windows 2003升级到Windows 2008 R2之后,我也遇到了同样的问题,我只是将应用程序池设置更改为.NetFramework 4.0.0,并将经典的应用程序池设置更改为集成模式……我的问题解决了。

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20063861

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档