Unable to host website using system.web.extensions

I am developing a .net 4.0 web application where I host it in IIS. The application was successfully hosted several times without using the <system.web.extensions> web.config in web.config .

The application is published without any errors, but when I try to host it using IIS and try to enable Directory Browsing , it throws an error The configuration section system.web,extensions cannot be read because its missing a section declaration . I already installed it as a .net 4.0 application from the application pool, but still threw an error.

Below is my web.config ,

  <?xml version="1.0"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <system.web> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/> <add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> </assemblies> </compilation> <httpRuntime requestValidationMode="2.0" executionTimeout="1000" maxRequestLength="2147483647" /> </system.web> <system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength="2147483647"> </jsonSerialization> </webServices> </scripting> </system.web.extensions> </configuration> 

Can I find out what I'm doing wrong here ... this is such a headache, and I tried most of the resources on the Internet, but everyone suggests installing the application pool on .net 4.0 , which I already did ..

Thank you for help:)

+4
source share
3 answers
 <configuration> <configSections> <section name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup" /> </configSections> </configuration> 

Add this to the configuration sections. Its strange that it does not default in applicationHost.config

+11
source

If you download the 4.0 application in IIS with the application pool installed for 2.0-3.5 Integrated Pipeline, then you will see an error about the absence of a section declaration for the extension.

You need to install the application pool for 4.0-4.5 Integrated Pipeline in IIS.

+2
source

You can solve the problem by adding the following configuration parameter to the webconfig file

 <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> 
+1
source

All Articles