4

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"/>
thematt
  • 185
  • 1
  • 2
  • 15
  • Show us your Web.config – SLaks Oct 24 '13 at 14:33
  • I also can't change what's in this referenced web.config I am only referencing files in this for a static HTML page.. – thematt Oct 24 '13 at 14:38
  • could this be because my local machine only has .net 4.0 and it seems to reference 3.5 ? do i need to add 3.5 to my pool? and change this project to 3.5? – thematt Oct 24 '13 at 14:43
  • You should delete that line; it's already in the default schema for newer IISes. Setting the site to a 3.5 app pool in IIS _might_ help. – SLaks Oct 24 '13 at 14:47
  • installing 3.5 fixed my issue – thematt Oct 24 '13 at 15:41
  • Possible duplicate of [IIS7 deployment - duplicate 'system.web.extensions/scripting/scriptResourceHandler' section](http://stackoverflow.com/questions/3387322/iis7-deployment-duplicate-system-web-extensions-scripting-scriptresourcehandl) – bluish Oct 23 '15 at 09:52

2 Answers2

4

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

Luke Rixson
  • 607
  • 5
  • 20
  • [Here](https://blogs.msdn.microsoft.com/gaurav/2013/10/01/there-is-a-duplicate-scriptresourcehandler-section-defined/) is a good explanation why this error appears. – elshev Feb 22 '17 at 15:01
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

Community
  • 1
  • 1
gkakas
  • 168
  • 5