title: Cannot host website with system.web.extensions
body: <p>I am developing an .net 4.0 web application where I host it on IIS. The application was successfully hosted several times without the use of <code>&lt;system.web.extensions&gt;</code> in <code>web.config</code> file.</p>
  
  <p>The application gets published without any errors, but when I try to host it using <code>IIS</code> and try to enable  <code>Directory Browsing</code> it gives out the error <code>The configuration section system.web,extensions cannot be read because its missing a section declaration</code>. I've already set it up as .net 4.0 application from the application pool but still gives the error. </p>
  
  <p>Following is my <code>web.config</code> file,</p>
  
  <pre><code>  &lt;?xml version="1.0"?&gt;
    &lt;!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      --&gt;
    &lt;configuration&gt;
      &lt;system.web&gt;
        &lt;compilation debug="true" targetFramework="4.0"&gt;
          &lt;assemblies&gt;
            &lt;add assembly="MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/&gt;
            &lt;add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt;
          &lt;/assemblies&gt;
        &lt;/compilation&gt;
        &lt;httpRuntime requestValidationMode="2.0" executionTimeout="1000" maxRequestLength="2147483647" /&gt;
      &lt;/system.web&gt;
      &lt;system.web.extensions&gt;
        &lt;scripting&gt;
          &lt;webServices&gt;
            &lt;jsonSerialization maxJsonLength="2147483647"&gt;
            &lt;/jsonSerialization&gt;
          &lt;/webServices&gt;
        &lt;/scripting&gt;
      &lt;/system.web.extensions&gt;
    &lt;/configuration&gt;
  </code></pre>
  
  <p>May I know what i'm doing wrong here..this is such a headache  and I've tried most of the resources online but all suggest to set the application pool to <code>.net 4.0</code> which I have already done..</p>
  
  <p>Many thanks for the help :)</p>