IIS 7.5 Web.config Error from Wrong Application

asp.netiiswindows-server-2008-r2

I have a Default Web site set up in IIS 7.5 on Win2008 Server R2.

There are multiple ASP.NET 2.0 applications under the Default Web site.
Currently, I am trying to deploy a new precompiled ASP.Net 4.0 application to the Default Web site, but the Web server is returning a HTTP 500.19 error describing a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined in the Web.config. However, the Web.config file path that the error references is for a different application under the Default Web site than the one I am trying to open.
For example, I am putting in the URL for the new ASP.NET 4.0 application but the Web.config error it is giving me is for one of the 2.0 applications. The virtual paths are correct and each application has its own App Pool.

Any ideas what may be causing this problem?

Best Answer

The root of your Default Web Site is an application too - you'll probably find it's using the DefaultAppPool and it's configured to use .Net 2.0. The configuration may be inherited from here.

You could try one of these:

  1. If there is no application configured at the root of the site you could try changing the DefaultAppPool settings to 'No Managed Code'
  2. Turn off inheritance from the root app using inheritInChildApplications="false"
  3. Use a <remove... > tag for each conflicting module before they get added with <add...>

Bear in mind that 1 and 2 could affect your child apps if they rely on any of the inherited settings.

Related Topic