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

IIS6 to IIS7 Handler Migration

08/20/08

  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:


<system.web>
  <httpHandlers>
   <remove verb="*" path="*.asmx"/>
   <add verb="*" path="*.asmx" validate="false"
   type="System.Web.Script.Services.ScriptHandlerFactory,
   System.Web.Extensions, Version=1.0.61025.0,
   Culture=neutral,
   PublicKeyToken=31bf3856ad364e35"/>
   <add verb="GET,HEAD" path="ScriptResource.axd"
   type="System.Web.Handlers.ScriptResourceHandler,
   System.Web.Extensions, Version=1.0.61025.0,
   Culture=neutral, PublicKeyToken=31bf3856ad364e35"
   validate="false"/>
  </httpHandlers>
</system.web>

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:


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

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]
Tara

Thank you. This was great information.

02/12/09 @ 17:50
March 2019
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Ritchie Annand's blog of everything except sports (...and who knows? I may break that rule some day)

Search

  XML Feeds

blog tool