“经典”和“经典”有什么区别? 和“集成”; IIS7中的管道模式?
昨晚我正在部署一个 ASP.NET MVC 应用程序,发现将 IIS7 设置为集成模式进行部署会减少工作量。 我的问题是有什么区别? 使用其中一种或另一种会有什么影响?
I was deploying an ASP.NET MVC application last night, and found out that it is less work to deploy with IIS7 set to integrated mode. My question is what is the difference? And what are the implications of using one or the other?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
经典模式(IIS6及以下版本中的唯一模式)是IIS仅直接与ISAPI扩展和ISAPI过滤器一起工作的模式。 事实上,在这种模式下,ASP.NET只是一个ISAPI扩展(aspnet_isapi.dll)和一个ISAPI过滤器(aspnet_filter.dll)。 IIS 只是将 ASP.NET 视为在 ISAPI 中实现的外部插件,并像黑匣子一样使用它(并且仅当需要向 ASP.NET 发出请求时)。 在这种模式下,ASP.NET 与 PHP 或 IIS 的其他技术没有太大区别。
另一方面,集成模式是 IIS7 中的一种新模式,其中 IIS 管道与 ASP.NET 请求管道紧密集成(即完全相同)。 ASP.NET 可以查看它想要的每个请求并在此过程中进行操作。 ASP.NET 不再被视为外部插件。 它完全混合并集成在 IIS 中。 在这种模式下,ASP.NET
HttpModule
基本上具有与 ISAPI 过滤器几乎相同的功能,并且 ASP.NETHttpHandler
可以具有与 ISAPI 几乎相同的功能扩展可以有。 在这种模式下,ASP.NET基本上是IIS的一部分。Classic mode (the only mode in IIS6 and below) is a mode where IIS only works with ISAPI extensions and ISAPI filters directly. In fact, in this mode, ASP.NET is just an ISAPI extension (aspnet_isapi.dll) and an ISAPI filter (aspnet_filter.dll). IIS just treats ASP.NET as an external plugin implemented in ISAPI and works with it like a black box (and only when it's needs to give out the request to ASP.NET). In this mode, ASP.NET is not much different from PHP or other technologies for IIS.
Integrated mode, on the other hand, is a new mode in IIS7 where IIS pipeline is tightly integrated (i.e. is just the same) as ASP.NET request pipeline. ASP.NET can see every request it wants to and manipulate things along the way. ASP.NET is no longer treated as an external plugin. It's completely blended and integrated in IIS. In this mode, ASP.NET
HttpModule
s basically have nearly as much power as an ISAPI filter would have had and ASP.NETHttpHandler
s can have nearly equivalent capability as an ISAPI extension could have. In this mode, ASP.NET is basically a part of IIS.摘自:IIS7 中的 DefaultAppPool 和 Classic .NET AppPool 之间有什么区别?
原始来源:IIS 体系结构简介
Taken from: What is the difference between DefaultAppPool and Classic .NET AppPool in IIS7?
Original source: Introduction to IIS Architecture
ASP.NET 通过 ISAPI 扩展、C API(基于 C 编程语言的 API)与 IIS 集成,并公开其自己的应用程序和请求处理模型。
这有效地公开了两个独立的服务器(请求/响应)管道,一个用于本机 ISAPI 过滤器和扩展组件,另一个用于托管应用程序组件。 ASP.NET 组件将完全在 ASP.NET ISAPI 扩展气泡内执行并且仅对于在 IIS 脚本映射配置中映射到 ASP.NET 的请求。
对非 ASP.NET 内容类型的请求:图像、文本文件、HTML 页面和无脚本 ASP 页面由 IIS 或其他 ISAPI 扩展处理,并且对 ASP.NET 不可见。
此模型的主要限制是 ASP.NET 模块和自定义 ASP.NET 应用程序代码提供的服务不可用于非 ASP.NET 请求
什么是 SCRIPT MAP?
脚本映射用于将文件扩展名与请求该文件类型时执行的 ISAPI 处理程序关联起来。 脚本映射还有一个可选设置,用于在允许处理请求之前验证与请求关联的物理文件是否存在。
一个很好的例子是
见此处
IIS 7.0 及更高版本经过重新设计,提供了基于 ISAPI 的全新 C++ API。
IIS 7.0 及更高版本将 ASP.NET 运行时与 Web 服务器的核心功能集成,提供统一(单一)请求处理管道,该管道向称为模块 ( IHttpModules ) 的本机组件和托管组件公开
这意味着什么IIS 7 处理到达任何内容类型的请求,
非 ASP.NET 模块/本机 IIS 模块
和ASP.NET 模块
在所有阶段提供请求处理 em> 这就是 .NET 模块可以处理非 ASP.NET 内容类型(.html、静态文件)的原因。IHttpModule
)能够执行所有应用程序内容,并为您的应用程序提供一组增强的请求处理服务。IHttpHandler
)ASP.NET integrated with IIS via an ISAPI extension, a C API ( C Programming language based API ) and exposed its own application and request processing model.
This effectively exposed two separate server( request / response ) pipelines, one for native ISAPI filters and extension components, and another for managed application components. ASP.NET components would execute entirely inside the ASP.NET ISAPI extension bubble AND ONLY for requests mapped to ASP.NET in the IIS script map configuration.
Requests to non ASP.NET content types:- images, text files, HTML pages, and script-less ASP pages, were processed by IIS or other ISAPI extensions and were NOT visible to ASP.NET.
The major limitation of this model was that services provided by ASP.NET modules and custom ASP.NET application code were NOT available to non ASP.NET requests
What's a SCRIPT MAP ?
Script maps are used to associate file extensions with the ISAPI handler that executes when that file type is requested. The script map also has an optional setting that verifies that the physical file associated with the request exists before allowing the request to be processed
A good example can be
seen here
IIS 7.0 and above have been re-engineered from the ground up to provide a brand new C++ API based ISAPI.
IIS 7.0 and above integrates the ASP.NET runtime with the core functionality of the Web Server, providing a unified(single) request processing pipeline that is exposed to both native and managed components known as modules ( IHttpModules )
What this means is that IIS 7 processes requests that arrive for any content type, with both
NON ASP.NET Modules / native IIS modules
andASP.NET modules
providing request processing in all stages This is the reason why NON ASP.NET content types (.html, static files ) can be handled by .NET modules.IHttpModule
) that have the ability to execute for all application content, and provided an enhanced set of request processing services to your application.IHttpHandler
)在经典模式下,IIS 直接运行 ISAPI 扩展和 ISAPI 过滤器。 并使用两条管道,一条用于本机代码,另一条用于托管代码。 您可以简单地说,在经典模式下,IIS 7.x 的工作方式与 IIS 6 相同,您不会从 IIS 7.x 功能中获得额外的好处。
在集成模式下,IIS 和 ASP.Net 紧密耦合,而不是像经典模式那样仅依赖于 Asp.net 上的两个 DLL。
In classic mode IIS works h ISAPI extensions and ISAPI filters directly. And uses two pipe lines , one for native code and other for managed code. You can simply say that in Classic mode IIS 7.x works just as IIS 6 and you dont get extra benefits out of IIS 7.x features.
In integrated mode IIS and ASP.Net are tightly coupled rather then depending on just two DLLs on Asp.net as in case of classic mode.