Managed Code Modules

Although there are several important differences, the Managed Code API shares some basic concepts with the Native Code API, and therefore the earlier section, “IIS Module Concepts” is recommended reading prior to beginning this section. You may also consider reviewing the sections covering the IIS 8.0 pipeline in Chapter 2 and ASP.NET integrated mode in Chapter 11 prior to proceeding with this section.

For those of you already familiar with HttpApplication events in previous versions of ASP.NET, the IIS 8.0 API will be a familiar and empowering extension.

IIS 8.0 ships with the special ManagedEngine utility module, which acts as a native code module wrapper for managed code modules. Figure 12.2 represents how the ManagedEngine module exposes IIS request-processing pipeline events to the managed code environment.

Notice that one major difference between the managed and native code functionality is that managed code modules do not set a return code back to IIS; instead, the modules use the CompleteRequest method of the HttpApplication class to interrupt the request-processing pipeline and go directly to the EndRequest event.

Another important difference is that not all the native notification events are available. For example, there is no equivalent of PostBeginRequest for managed code modules.

Nonetheless, the ability for managed code to now execute ...

Get Professional Microsoft IIS 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.