3

i have 2 servers and i've to migrate the website to one 2003 server to 2008 server. When i try to run the website in the 2008 server i have this error: There is a duplicate system.web.extensions/scripting/scriptResourceHandler section defined

But i don't have a duplicate 'system.web.extensions/scripting/scriptResourceHandler in the web.config. And when i delete this line then it complains about a duplicate of the next line, and so on until I remove almost all of the config sections.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!--DMS.BEGIN.DMS.BEGIN.DMS.BEGIN.DMS.BEGIN.DMS.BEGIN.DMS.BEGIN.DMS.BEGIN.DMS.BEGIN.DMS.BEGIN.DMS.BEGIN.DMS.BEGIN. -->
    <section name="EventListeners" type="System.Configuration.NameValueSectionHandler,System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <section name="policyInjection" type="Microsoft.Practices.EnterpriseLibrary.PolicyInjection.Configuration.PolicyInjectionSettings, Microsoft.Practices.EnterpriseLibrary.PolicyInjection, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
    <!--DMS.END.DMS.END.DMS.END.DMS.END.DMS.END.DMS.END.DMS.END.DMS.END.DMS.END.DMS.END.DMS.END.DMS.END.DMS.END.DMS.END. -->
    <!-- enables ASP.NET AJAX extensions -->
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
    <sectionGroup name="Config">
      <section name="SQLServer" type="System.Configuration.SingleTagSectionHandler,system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="Remoting" type="System.Configuration.SingleTagSectionHandler,system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="General" type="System.Configuration.SingleTagSectionHandler,system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="Pagination" type="System.Configuration.SingleTagSectionHandler,system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="ProxyServer" type="System.Configuration.SingleTagSectionHandler,system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="ERPWebServices" type="System.Configuration.SingleTagSectionHandler,system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="Licencing" type="System.Configuration.SingleTagSectionHandler,system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="SaaS" type="System.Configuration.SingleTagSectionHandler,system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="IISConfiguration" type="System.Configuration.SingleTagSectionHandler,system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="OtherInformation" type="System.Configuration.SingleTagSectionHandler,system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
    </sectionGroup>
  • There must be a duplicate somewhere, not necessarily in the same web.config file. The duplicate can be in another web.config file at different folder level, or in some case in [machine.config](http://stackoverflow.com/questions/3387322/iis7-deployment-duplicate-system-web-extensions-scripting-scriptresourcehandl?rq=1). For workaround, try adding `` before `
    `
    – har07 Dec 14 '15 at 13:21
  • Hi, when i do this then it complains about the next line:There is a duplicate 'system.web.extensions/scripting/webServices/jsonSerialization' section defined – Tatiana Santos Dec 14 '15 at 13:57
  • add `` elements for every `
    ` complained
    – har07 Dec 14 '15 at 13:59
  • After the final one appears that: Runtime Error Description: An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated. – Tatiana Santos Dec 14 '15 at 14:17
  • Have you changed the appPoll to version 2 instead of version 4? – Ricardo Alves Dec 15 '15 at 10:29
  • Hello, yes i have and doesn't work – Tatiana Santos Dec 15 '15 at 10:49

1 Answers1

0

I had this problem when the web site I was trying to setup and get running was supposed to be setup to run under .net 2.0/3.5 but I had it setup to run under .NET 4.0 by accident.

Background:

Per comment under the original issue "There must be a duplicate somewhere, not necessarily in the same web.config file. The duplicate can be in another web.config file at different folder level, or in some case in machine.config." I did find the duplicate. In the .net 4.0 machine.config, entries were there which duplicated the contents of my web.config, which resulted in the duplicate error. However, the .net 2.0 machine.config did not have duplicates with my web.config.

Switching the application pool to run .net 2.0, as it should have been in the first place, eliminated the error.

David Nelson
  • 156
  • 1
  • 5