Duplicate 'system.web.extensions/scripting/scriptResourceHandler'

18,189

Solution 1

This is a known issue with ASP.NET 4.0 / vs 2010

See http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes#0.1__Toc256770149

"The workaround for the second scenario is to delete or comment out all the system.web.extensions configuration section definitions and configuration section group definitions from the application-level

Web.config

file. These definitions are usually at the top of the application-level

Web.config

file and can be identified by the configSections element and its children."

Solution 2

The solutions that usually face the problem with changes in the application web.config section are fine, however they do not work when there is nesting of .net 4.0 applications inside .net 2.0 applications.

In this case the proper solution is to comment out the entries in machine.config, as appropriate, e.g.:

<!--
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
-->

Mind also that the appropriate machine config can be either in Framework/.../config or Framework64/.../config folder, depending on the architecture of the application. This is precisely explained here: https://stackoverflow.com/a/2325492/1347089

Share:
18,189
thematt
Author by

thematt

Updated on June 07, 2022

Comments

  • thematt
    thematt almost 2 years

    I'm rather new to IIS 7.5 and how to set something up, but here's what I am trying to do,

    I have plain html/css/js files in a IIS website, but I am referencing another project that has a web.config file, the only files I am referencing are .css and .js files yet I am getting a error 500.19 from IIS

    There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined

    These are shared files and is there something I would have to configure on my IIS website and create a web.config that would allow me to do this kind of reference?

    I am using IIS 7.5 and all projects are running under .net 4

    I can't show the very long web.config for security but this is the line causing the issue:

    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, requirePermission="false" allowDefinition="MachineToApplication"/>
    
  • elshev
    elshev about 7 years
    Here is a good explanation why this error appears.