Click here to Skip to main content
Click here to Skip to main content

IIS deployment error: There is a duplicate scriptResourceHandler section defined

, 15 Sep 2011
Rate this:
Please Sign up or sign in to vote.
How to fix this IIS deployment error.

A few days back, I was attempting to deploy a .NET 3.5 website on the default app pool in IIS 7 having the framework section set to 4.0, and I got the following error,

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

The problem occurs because when you use framework 4.0, the machine config already has some of the sections defined that were used in previous ASP.NEt versions. So replace the sectionGroup of your existing web.config with the below configs:

<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"/>
<section name="profileService" 
  type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, 
        Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
  requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" 
  type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, 
        Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
  requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" 
  type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, 
        Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
  requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>

Another workaround is to rebuild the website/web application using framework 4, and the problem goes away.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Shahriar Iqbal Chowdhury/Galib
Technical Lead
Bangladesh Bangladesh
I am a Software Engineer and Microsoft .NET technology enthusiast. Professionally I worked on several business domains and on diverse platforms. I love to learn and share new .net technology and my experience I gather in my engineering career. You can find me from here
 
Personal Site
Personal Blog
FB MS enthusiasts group
About Me

Comments and Discussions

 
QuestionAlternative Pinmemberporcus5-Dec-12 13:55 
QuestionIIS deployment error PinmemberNiroj Sc Ray30-Nov-12 18:08 
GeneralMy vote of 5 PinmemberRaidenets6-Sep-12 1:11 
GeneralMy vote of 5 PinmemberRubaba11-Dec-11 0:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140814.1 | Last Updated 15 Sep 2011
Article Copyright 2011 by Shahriar Iqbal Chowdhury/Galib
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid