“经典”和“经典”有什么区别? 和“集成”; IIS7中的管道模式?

发布于 2024-07-16 12:46:45 字数 93 浏览 8 评论 0原文

昨晚我正在部署一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

揽清风入怀 2024-07-23 12:46:45

经典模式(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.NET HttpHandler 可以具有与 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 HttpModules basically have nearly as much power as an ISAPI filter would have had and ASP.NET HttpHandlers can have nearly equivalent capability as an ISAPI extension could have. In this mode, ASP.NET is basically a part of IIS.

吃颗糖壮壮胆 2024-07-23 12:46:45

集成应用程序池模式

当应用程序池处于集成模式时,您可以利用
IIS 和 ASP.NET 的集成请求处理体系结构。
当应用程序池中的工作进程收到请求时,
请求通过事件的有序列表。 每个事件都会调用
必要的本机和托管模块来处理部分
请求并生成响应。

在集成中运行应用程序池有几个好处
模式。 首先,IIS 和 ASP.NET 的请求处理模型是
集成到统一的流程模型中。 该模型消除了步骤
以前在 IIS 和 ASP.NET 中重复的内容,例如
验证。 此外,集成模式可实现可用性
所有内容类型的托管功能。

经典应用程序池模式

当应用程序池处于经典模式时,IIS 7.0 处理请求
与 IIS 6.0 工作进程隔离模式一样。 ASP.NET 请求先行
通过 IIS 中的本机处理步骤,然后路由到
Aspnet_isapi.dll 用于处理托管中的托管代码
运行。 最后,请求通过 IIS 路由回以发送
回应。

IIS 和 ASP.NET 请求处理模型的分离
导致一些处理步骤的重复,例如
身份验证和授权。 此外,托管代码功能,
例如表单身份验证,仅适用于 ASP.NET
应用程序或您已将脚本映射到所有的应用程序
由 aspnet_isapi.dll 处理的请求。

请务必测试现有应用程序的兼容性
生产环境升级到IIS 7.0之前的集成模式
并以集成模式将应用程序分配到应用程序池。
您应该只将应用程序添加到 Classic 中的应用程序池
模式(如果应用程序无法在集成模式下工作)。 例如,
您的应用程序可能依赖于从 IIS 传递的身份验证令牌
到托管运行时,并且由于 IIS 7.0 中的新体系结构,
该过程会破坏您的应用程序。

摘自:IIS7 中的 DefaultAppPool 和 Classic .NET AppPool 之间有什么区别?

原始来源:IIS 体系结构简介

Integrated application pool mode

When an application pool is in Integrated mode, you can take advantage
of the integrated request-processing architecture of IIS and ASP.NET.
When a worker process in an application pool receives a request, the
request passes through an ordered list of events. Each event calls the
necessary native and managed modules to process portions of the
request and to generate the response.

There are several benefits to running application pools in Integrated
mode. First the request-processing models of IIS and ASP.NET are
integrated into a unified process model. This model eliminates steps
that were previously duplicated in IIS and ASP.NET, such as
authentication. Additionally, Integrated mode enables the availability
of managed features to all content types.

Classic application pool mode

When an application pool is in Classic mode, IIS 7.0 handles requests
as in IIS 6.0 worker process isolation mode. ASP.NET requests first go
through native processing steps in IIS and are then routed to
Aspnet_isapi.dll for processing of managed code in the managed
runtime. Finally, the request is routed back through IIS to send the
response.

This separation of the IIS and ASP.NET request-processing models
results in duplication of some processing steps, such as
authentication and authorization. Additionally, managed code features,
such as forms authentication, are only available to ASP.NET
applications or applications for which you have script mapped all
requests to be handled by aspnet_isapi.dll.

Be sure to test your existing applications for compatibility in
Integrated mode before upgrading a production environment to IIS 7.0
and assigning applications to application pools in Integrated mode.
You should only add an application to an application pool in Classic
mode if the application fails to work in Integrated mode. For example,
your application might rely on an authentication token passed from IIS
to the managed runtime, and, due to the new architecture in IIS 7.0,
the process breaks your application.

Taken from: What is the difference between DefaultAppPool and Classic .NET AppPool in IIS7?

Original source: Introduction to IIS Architecture

迷荒 2024-07-23 12:46:45

IIS 6.0 及之前版本:

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 及更高版本

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)

IIS 6.0 and previous versions :

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 and above

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 and ASP.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.

  • You can build new managed modules (IHttpModule) that have the ability to execute for all application content, and provided an enhanced set of request processing services to your application.
  • Add new managed Handlers ( IHttpHandler)
红衣飘飘貌似仙 2024-07-23 12:46:45

在经典模式下,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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文