views:

226

answers:

2

I have an application in an application pool that's running in integrated mode. I have added a handler to system.web > httpHandlers and I kept getting a 404 result. So I enabled failed request tracing and in the request details I see multiple entires like this:

HANDLER_PRECONDITION_NOT_MATCH Name: PageHandlerFactory-ISAPI-2.0 Precondition classicMode,runtimeVersionv2.0,bitness32

The precondition always seems to be classicMode. Why is IIS 7 trying to match the request to these handlers when the application pool is running in integrated mode?

Thanks!

A: 

Your HttpHandler should actually be configured in the <system.webServer/> section of your web.config file.

Kev
I know that now, but it doesn't explain the request trace.
michielvoo
A: 

I didn't find out why it was set in classicMode by default, but this blog explained the various preconditions very well: http://blogs.iis.net/thomad/archive/2006/11/04/precondition-what.aspx

Here is an excerpt from the blog regarding "The Mode Precondition":

The Mode Precondition

The new managed module and managed handler extensibility allows you to add managed code, i.e. ASP.NET pages, modules and handlers, directly into the IIS7 pipeline. IIS7 needs to run the worker process in a particular way for this to work. It needs to load the .NET Framework 2.0 and it also needs to run a module called webengine.dll. Webengine.dll does all the work of hooking up managed modules with the IIS7 pipeline because IIS7 itself doesn’t know about managed code. The new way to integrate ASP.NET pages, modules and handlers is called “Integrated Mode”.

But there is still the good old way to hook up managed code in IIS7, i.e. via the ISAPI interface. ASPNET_ISAPI.DLL used to do this in IIS 5, 5.1 and 6.0. IIS7 continues to support the ISAPI hookup if you run the worker process in “classic Mode”.

As a result IIS7 introduced two preconditions called “integratedMode” and “classicMode”. A handler that has an “integratedMode” precondition associated with it will only be loaded into an Application Pool that has the “integratedMode” property set on the ApplicationPool. Handlers with the “classicMode” precondition will only be loaded into Application Pools that have the integratedMode property set to false.

Solburn