本文介绍了了解IIS7.5上的处理程序映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出处理程序映射在IIS7.5的意义和IIS如何使用这些信息来决定谁执行的。

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.

比如我看到几个条目与*的.aspx路径。哪一个胜?难道说,当综合管线使用某些条目只有在启用经典管道应用和其他一些人?而位数(32位,64位)影响的条目被认为?

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?

如果有人可以解释(或者有一个链接解释)IIS7.5什么呢(在调度/路由/你采取照顾!而言)当一个普通的HTTP请求来了:

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

后来我会有兴趣在IIS重写模块或ARR,如何工作,但现在我只是在手柄映射配置的兴趣。

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.

感谢提前!

推荐答案

Fallow's回答是不太准确,处理程序映射IIS7从IIS6脚本映射不同的处理。

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

在IIS7的管理控制台有一个在UI未显示的重要因素,在 preCondition 属性。

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

preCondition 属性用于指定当处理程序应被调用。要回答你的问题:

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

比如我看到几个条目与*的.aspx路径。哪一个
  赢了?会不会是某些条目仅适用于在经典管道
  即使能综合使用其他一些管道?而
  该项目被认为位数(32位,64位)的影响?

不同pre-条件,用来决定哪些的.aspx 处理程序应被调用。例如,一个64位系统,ASP.NET 2.0和ASP.NET 4.0上安装有定义了六种可能的的.aspx 处理器映射。每个人都有不同的 preCondition 规则:

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" />

如果你看一下每个 preConditions 上面他们都略有不同,这是IIS如何选择要执行的处理程序映射。

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

也有这解释处理器映射一个伟大的文章和 preConditions 这里:

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

这篇关于了解IIS7.5上的处理程序映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 02:50