IIS setup error. There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined

I’m trying to deploy a .net 3.5 web application.
If I manually deploy the site works just fine. ie. The server has all the correct dependencies installed.

When I try to deploy through Octopus I get the error
There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’ section defined

This is an error you get when trying to run a 3.5 site in the 4.0 runtime. I have the config set to the 2.0CLR though so it should be working.

Is there something octopus is doing that uses 4.0 regardless of what CLR I select in the process options?

Hi Kareem,

Could you please confirm which version of Octopus Deploy you’re using? In Octopus v1.6 the Application Pool will only be updated is there is a custom PowerShell script that does so. Octopus itself will never update the Application Pool. In Octopus v2 the feature IIS Websites and Application Pools lets you specify what .NET CLR version the Application Pool will be configured to, and will update existing Pools.

In Octopus v2 remember to create a new release if you change any Steps.

Hope that helps!


I’m using Octopus 2.0 and the IIS Websites and Application Pools feature is configured to use CLR 2.0. I’m creating a new release with every config change to test.

It appears to me that Octopus 2.0 is using the 4.0 CLR to do the web.config changes even though it deploys and sets up IIS for 2.0.

Hi Kareem,

Could you answer a few more questions for me about your issue?

  1. Can you confirm that the error that you are getting is when running the website through IIS after it’s deployed?
  2. If you change the Application Pool to version 2.0 manually after the deployment, does it then work?
  3. If you deploy the site again does the App Pool version change back to 4.0?
  4. Do you have any custom PowerShell scripts that could change the Application Pool settings?


  1. The error is during the deploy when it’s trying to modify the web.config.
  2. Octopus successfully creates the pool configured with CLR 2.0.
  3. The deploy never succeeds.
  4. None.

Key point. The failure is during the deploy. If I manually deploy the same
package the site runs just fine. This is not a runtime issue in iis. This
is an issue during the Octopus deploy.

Hi Kareem,

Thanks for supplying us with all the extra info.
It’s looking like a bug with how we invoke powershell and the CLR version it uses.
I’ve submitted an issue which you can track here.

To resolve this we will need a copy of a deployment log with this issue, sorry again to ask for further information!