开发者

Understanding Handler mapping on IIS7.5

I'm trying to figure out the meaning of Handler Mapping in IIS7.5 and how IIS use this information to decide who executes what.

For instance I see several entries with the *.aspx path. Which one wins? Could it be that some entries only applies when Classic Pipeline is enabled and some others when Integrated pipeline is used? And the bitness (32 bit, 64bit) influence which entries are considered?

If someone could explain (or have a link explaining) what IIS7.5 does (in terms of "dispatching"/"routing"/"you! take care of that!") when a generic HTTP request comes:

    GET /blabla/dummy.bla HTTP/1.1
    Host: blabla.org

Later on I would be interested in how the IIS Rewrite开发者_运维百科 Module or ARR, works, but for now I'm only interested in the Handle Mapping configuration.

Thank in advance!


Fallow's answer is not quite accurate, handler mappings IIS7 are handled differently from IIS6 script maps.

In IIS7's management console there is an important attribute not shown in the UI, the preCondition attribute.

The preCondition attribute is used to specify when a handler should be invoked. To answer your question:

For instance I see several entries with the *.aspx path. Which one wins? Could it be that some entries only applies when Classic Pipeline is enabled and some others when Integrated pipeline is used? And the bitness (32 bit, 64bit) influence which entries are considered?

Different pre-conditions are used to decide which .aspx handler should be invoked. For example, on a 64 bit system with ASP.NET 2.0 and ASP.NET 4.0 installed there are six possible .aspx handler mappings defined. Each one has a different preCondition rule:

<add name="PageHandlerFactory-ISAPI-4.0_32bit" 
     path="*.aspx" 
     modules="IsapiModule" 
     scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" 
     preCondition="classicMode,runtimeVersionv4.0,bitness32" />

<add name="PageHandlerFactory-ISAPI-4.0_64bit" 
     path="*.aspx"
     modules="IsapiModule" 
     scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" 
     preCondition="classicMode,runtimeVersionv4.0,bitness64" />

<add name="PageHandlerFactory-Integrated-4.0" 
     path="*.aspx" 
     type="System.Web.UI.PageHandlerFactory" 
     preCondition="integratedMode,runtimeVersionv4.0" />

<add name="PageHandlerFactory-Integrated" 
     path="*.aspx" 
     type="System.Web.UI.PageHandlerFactory" 
     preCondition="integratedMode" />

<add name="PageHandlerFactory-ISAPI-2.0" 
     path="*.aspx"
     modules="IsapiModule" 
     scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" 
     preCondition="classicMode,runtimeVersionv2.0,bitness32" />

<add name="PageHandlerFactory-ISAPI-2.0-64" 
     path="*.aspx" 
     modules="IsapiModule" 
     scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" 
     preCondition="classicMode,runtimeVersionv2.0,bitness64" />

If you look at each of the preConditions above they're all slightly different, this is how IIS chooses which handler mapping to execute.

For more information see:

http://www.iis.net/ConfigReference/system.webServer/handlers/add

Also there's a great article which explains handler mappings and their preConditions here:

Achtung! IIS7 Preconditions


The following post pertains to IIS 6.0 but i have found no evidence that the behavior differs in IIS 7.X.

IIS checks if any wildcard application mappings are present in ScriptMaps and if so, invokes the first wildcard application mapping in ORDER from the ScriptMaps property.

Only when the wildcard application mapping returns and tells IIS "I am NOT handling this request" does IIS invoke the next wildcard application mapping... until IIS either goes through all wildcard application mappings or some wildcard application mapping declares "I AM handling this request"."

The link to the post is: http://blogs.msdn.com/b/david.wang/archive/2005/10/14/howto-iis-6-request-processing-basics-part-1.aspx


Above solution does not works for me, i have tried the below steps and it works: open the ISAPI Filters module in IIS Manager and remove the aspnet_isapi.dll from the list. The aspnet_isapi.dll is an ISAPI extension and not an ISAPI filter.

For more information, please see: http://forums.iis.net/t/1107699.aspx?HTTP+error+500+0+error+code+0x800700b7

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜