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

IIS deployment error: There is a duplicate scriptResourceHandler section defined

By , 15 Sep 2011
 

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)

About the Author

Shahriar Iqbal Chowdhury/Galib
Technical Lead
Bangladesh Bangladesh
Member
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

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionAlternativememberporcus5 Dec '12 - 13:55 
QuestionIIS deployment errormemberNiroj Sc Ray30 Nov '12 - 18:08 
GeneralMy vote of 5memberRaidenets6 Sep '12 - 1:11 
GeneralMy vote of 5memberRubaba11 Dec '11 - 0:32 

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130513.1 | Last Updated 15 Sep 2011
Article Copyright 2011 by Shahriar Iqbal Chowdhury/Galib
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid