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

  • Question

  • User-826062482 posted

    I am trying to create an MVC2 web application that will run both on my local development machine (on localhost), and on our central webserver.

    Development machine:

    • Windows 7 Professional, 64bit
    • Visual Studio 2010 (beta)
    • ASP.NET 4.0
    • IIS 7.5

    Webserver:

    • Windows Server 2003 SP2
    • ASP.NET 3.5 SP1 (determined by checking the folders under %SystemRoot%\Microsoft.NET\Framework)
    • IIS 6.0

    Everything works fine when debugging from VS, and I've finally gotten so far that it also works copied to the webserver. However, when I try to copy it to my own local webserver, I get the following error message:

    <fieldset><legend>Error Summary</legend>

    HTTP Error 500.19 - Internal Server Error

    The requested page cannot be accessed because the related configuration data for the page is invalid.

    </fieldset>
    <fieldset><legend>Detailed Error Information</legend>
    Module IIS Web Core
    Notification BeginRequest
    Handler Not yet determined
    Error Code 0x800700b7
    Config Error There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined
    Config File \\?\C:\Temp\test2\web.config
    Requested URL http://localhost:80/mvc2
    Physical Path C:\Temp\test2
    Logon Method Not yet determined
    Logon User Not yet determined
    </fieldset>
    <fieldset> <legend>Config Source</legend>
       13: 			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    14: <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    15: <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    </fieldset>

    It almost goes without saying, I can not see any duplicate scriptResourceHandler section at all!

    The application I am testing on, is the default application that is created when you use the ASP.NET MVC2 Web Application template. The target framework for the application is .NET 3.5. (Because it has to run on our central .NET 3.5 webserver.)

    Is see now that I a comparable error message when trying to configure the web application in IIS7:

    There was an error while performing this operation.

    Details:

    Filename: \\?\C:\Temp\test2\web.config
    Line number: 14
    Error: There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined


    Tuesday, June 22, 2010 6:41 AM

Answers

  • User-345632295 posted

    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."

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 24, 2010 8:11 PM

All replies

  • User470413944 posted

    Hi,

    Correct me if I made a mistake, do you close the  sectionGroup scripting?

    I'm looking forward for your reply.

    Thursday, June 24, 2010 4:18 AM
  • User-345632295 posted

    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."

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 24, 2010 8:11 PM
  • User-826062482 posted

    Hmmm there is definitely something wrong with the email notification system -- I never received any warning about replies to my question...

    Anyhow, thanks for the replies!

    Correct me if I made a mistake, do you close the  sectionGroup scripting?

    Yes, the sectionGroup is closed. Like I said, this is the standard ASP.NET MVC2 Web Application template, without any modifications.

    Tuesday, June 29, 2010 3:36 AM
  • User-826062482 posted

    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."

    That did the trick! Wow, you would've thought such a problem would show up bug-tests... Thanks a million Bruce -- I can continue happy coding Wink

    Tuesday, June 29, 2010 3:47 AM
  • User-345632295 posted

    when you work in a hosting company, you get to see all these weird problems early Laughing..

    Tuesday, June 29, 2010 8:02 PM
  • User-2093669957 posted

    Commenting out the <sectionGroup name="system.web.extensions"...> worked for me.

    Thanks!

    Tim 

    Thursday, October 21, 2010 10:52 AM
  • User977894839 posted

    After commenting out the system.web.extension I got a further error wanting the  me to set the 

    <customErrors mode="RemoteOnly"

    After I did that I got the following error:

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: The browser or gateway element with ID 'safari1plus' cannot be found.

    Source Error:

    Line 1:  <browsers>
    Line 2:    <browser refID="safari1plus">
    Line 3:      <controlAdapters>
    Line 4:        <adapter controlType="System.Web.UI.WebControls.Menu" adapterType="" />

    Source File: C:\dashCommerce WebReady\WebReady\App_Browsers\chrome.browser    Line: 2


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

    <!-- [ConfigurationErrorsException]: The browser or gateway element with ID 'safari1plus' cannot be found. (C:\dashCommerce WebReady\WebReady\App_Browsers\chrome.browser line 2) at System.Web.Compilation.ApplicationBrowserCapabilitiesCodeGenerator.GenerateCode(AssemblyBuilder assemblyBuilder) at System.Web.Compilation.AssemblyBuilder.AddBuildProvider(BuildProvider buildProvider) [HttpParseException]: The browser or gateway element with ID 'safari1plus' cannot be found. (C:\dashCommerce WebReady\WebReady\App_Browsers\chrome.browser line 2) at System.Web.Compilation.AssemblyBuilder.AddBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BrowserCapabilitiesCompiler.GetBrowserCapabilitiesType() at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() [HttpException]: The browser or gateway element with ID 'safari1plus' cannot be found. (C:\dashCommerce WebReady\WebReady\App_Browsers\chrome.browser line 2) at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) [HttpException]: The browser or gateway element with ID 'safari1plus' cannot be found. (C:\dashCommerce WebReady\WebReady\App_Browsers\chrome.browser line 2) at System.Web.HttpRuntime.FirstRequestInit(HttpContext context) at System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) -->

    Is there some other application that I need to load to my local machine?

     

    Thanks

    Sunday, October 24, 2010 3:45 PM
  • User1587650447 posted

    Even i faced same issue while creating MVC application and sharepoint portal configuraiton. I have sucessfully fixed this issue and check this post

    http://code.cmsstores.com/there_is_a_duplicate_scriptresourcehandler_section_defined/

    Thursday, April 21, 2011 1:20 AM
  • User446615338 posted

    If you set the appropriate FRAMEWORK VERSION on the Application Pool ,it will work correctly.

     Projects developed in (2.0,3.0,3.5) should run under an Application Pool with .NET FRAMEWORK VERSION v2.0.50727 

     Projects developed in 4.0 should run under an Application Pool with .NET FRAMEWORK VERSION v4.0.30319

    Friday, September 6, 2013 10:03 AM