« Evolution, Alberta and Headdesk Denyse - Part IIEvolution, Alberta and Headdesk Denyse - Part I »

IIS6 to IIS7 Handler Migration


  01:38:29 pm, by Nimble   , 341 words  
Categories: Programming

IIS6 to IIS7 Handler Migration

We had one big hiccup moving from IIS 6.0 to the 7.0 version.

In the Web.Config, IIS 7.0 no longer likes to have an httpHandlers section. We had:

   <remove verb="*" path="*.asmx"/>
   <add verb="*" path="*.asmx" validate="false"
   System.Web.Extensions, Version=1.0.61025.0,
   <add verb="GET,HEAD" path="ScriptResource.axd"
   System.Web.Extensions, Version=1.0.61025.0,
   Culture=neutral, PublicKeyToken=31bf3856ad364e35"

A very good guide to IIS 7.0 migration issues is located here, and we used that to help guide our transition, though it missed a couple of issues.

We had to put in a <system.webServer> section. We moved the <httpHandlers> code into there, but instead of <httpHandlers>, the section should now be called <handlers>.

One thing that is not mentioned is that your handlers should have names now, so we tried changing things like this:

   <remove name="asmx" verb="*" path="*.asmx" />
   <add name="asmx" verb="*" path="*.asmx" ... />
   <add name="scriptResource" verb="GET,HEAD" ... />

Trying the web server yet again, we ran into another error, "unrecognized attribute 'verb'" on the "remove" line.

Well, it turns out that the remove syntax has changed, such that you only need the name. We had been fooled by the IIS 6.0 similarity between the add and remove syntax and thinking it still applied.

Changing the remove line to just:

   <remove name="asmx" />

...worked just fine.

This did not come up in our searches for "unrecognized attribute "verb", so hopefully, this saves someone else a bit of time.

1 comment

Comment from: Tara [Visitor]

Thank you. This was great information.

02/12/09 @ 17:50