当应用程序在集成模式下运行时,为什么 IIS7 会匹配具有 classicmode 前提条件的处理程序?
我的应用程序池中有一个以集成模式运行的应用程序。我已向 system.web > 添加了一个处理程序httpHandlers 和我不断收到 404 结果。因此,我启用了失败的请求跟踪,并且在请求详细信息中我看到了多个如下整体:
HANDLER_PRECONDITION_NOT_MATCH 名称:PageHandlerFactory-ISAPI-2.0 前提条件 classicMode,runtimeVersionv2.0,bitness32
前提条件似乎总是 classicMode。当应用程序池以集成模式运行时,为什么 IIS 7 会尝试将请求与这些处理程序匹配?
谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的 HttpHandler 实际上应该在
web.config
文件的
部分进行配置。Your HttpHandler should actually be configured in the
<system.webServer/>
section of yourweb.config
file.我没有找到为什么默认设置为 classicMode,但是这个博客很好地解释了各种前提条件: http://blogs.iis.net/thomad/archive/2006/11/04/precondition-what.aspx
以下是有关“的博客摘录”模式前提条件》:
模式前提条件
新的托管模块和托管处理程序可扩展性允许您将托管代码(即 ASP.NET 页面、模块和处理程序)直接添加到 IIS7 管道中。 IIS7 需要以特定方式运行工作进程才能正常工作。它需要加载.NET Framework 2.0,还需要运行一个名为 webengine.dll 的模块。 Webengine.dll 完成将托管模块与 IIS7 管道挂钩的所有工作,因为 IIS7 本身不了解托管代码。集成 ASP.NET 页面、模块和处理程序的新方法称为“集成模式”。
但在 IIS7 中仍然有一种很好的旧方法来连接托管代码,即通过 ISAPI 接口。 ASPNET_ISAPI.DLL 用于在 IIS 5、5.1 和 6.0 中执行此操作。如果您在“经典模式”下运行工作进程,IIS7 将继续支持 ISAPI 连接。
因此,IIS7 引入了两个先决条件,称为“integratedMode”和“classicMode”。具有与其关联的“integratedMode”先决条件的处理程序只会加载到在应用程序池上设置了“integratedMode”属性的应用程序池中。具有“classicMode”前提条件的处理程序只会加载到 IntegratedMode 属性设置为 false 的应用程序池中。
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.