JoelBlogs - Joel Jeffery's Microsoft 365 Blog

Microsoft 365, SharePoint, Teams and Office 365 Architecture, Development, Administration and Training

  • Home
    • Sitemap
  • Articles
    • #SPThingADay
    • SharePoint Online
      • SharePoint Online – Drag and Drop and Large File Uploads
    • SharePoint 2016
    • SharePoint 2013
      • Content Database Changes to the AllUserData Table
    • SharePoint 2010
      • Administration
        • Disable CRL Checking
        • Excel 2010 & PowerPivot
        • Limits & Thresholds
        • PeoplePicker AD Errors
        • Recycle Bin Behaviour
        • Renaming a Server
        • Service Pack 1
        • Unattended Installs
        • Uninstall All SharePoint 2010 Solutions via PowerShell
        • User Alert Management
        • Virtualised SharePoint
        • Visio Stencils for Administrators
      • Development
        • Audience Membership Workflow Activity
        • Base Types, Lists & Content Types
        • BCS & Offline Sync
        • Debugger Skipping Lines
        • Development Laptop Spec
        • Enabling JavaScript IntelliSense
        • Event Receivers & Deployment Jobs
        • FavIcons & SPUrl
        • Google Maps Sandbox Web Part
        • Group By Content Type for List Views
        • Locale Stapler / Master or Default Locale
        • Removing Default Editor Parts
        • Sandbox Embedding Resources
        • Solution Sandbox Introduction
        • SPPersistedObject
        • Restoring Deleted SPSites in SP1
        • SPWebConfigModification 1
        • SPWebConfigModification 2
        • STSADM copyappbincontent vs. Install-SPApplicationContent
        • Workflows for Beginners
        • Workflow InitiationData Seralizer
    • SharePoint 2007
      • Alternate Access Mappings
      • Excel Services
      • Excel Services UDFs & Excel Client 2007
      • Experiences from the Field
      • InfoPath & Forms Server
      • Kerberos & SSRS
      • Records Management
      • Web Application Service
      • WSS vs MOSS
  • Training
    • SharePoint Admin Links
  • Downloads
    • Summary Slides for PowerPoint
    • CodePlex Projects
      • Audience Membership Workflow Activity
      • Google Maps Sandbox Web Part
      • Group By Content Type in List Views
      • Locale Stapler / Master or Default Locale
      • SharePoint Outlook Connector
  • Hire Me!
    • MCP Transcript
    • Résumé/CV

Extending the IIS 7 Pipeline – Carlos Aguilar Mares

November 13, 2007 by Joel Jeffery

Tue, 13 Nov 2007 22:05:36 GMT

Carlos Aguilar Mares
Senior Development Lead

It seems the architecture of IIS has changed substantially with this release. If IIS6 was the bedrock that got us to Application Pools, and good .NET integration, IIS7 takes us to a new level. The IIS team has done a lot of refactoring to get there.

 

IIS6

IIS7

Monolithic server implementation

Componentised Server

Limited customisation

Pluggable modular functionality

Fixed functionality

Small generic request pipeline

Extensibility limited to ISAPI Filters

Enables lightweight servers and specialised servers

 

In IIS6, ASP.NET is implemented as an ISAPI filter, which sits right at the end of the pipeline. This caused a few problems – including duplication of features and wasted computation; authentication in ASP.NET would happen after IIS6 authenticated anyway. Another example of authentication badness in IIS6 occurs when you try to secure non-ASP.NET assets: you can only accomplish this by funnelling all HTTP requests via ASP.NET.

IIS7 offers two integrations models: Classic Mode (for compatibility – like IIS6) and Integrated Mode. ASP.NET is now implemented as a bundle of modules that fit into the redesigned IIS pipeline. Integrated Mode can process *all* requests and gives hider fidelity notifications.

.NET Extensibility

  • Existing ASP.NET API – using IHttpModel and IHttpHandler types
  • Expanded ASP.NET APIs
    • New HttpApplication Events
      • MapRequestHandler, LogRequest, PostLogRequest
    • Inject and modify IIS system headers and collections
      • HttpRequest.Headers
      • HttpReponse.Headers
      • HttpReponse.DisableKernelCache
      • HttpReponse.ServerVariables

Handlers vs Modules

 

Modules

Handlers

Provide services to all requests

Provides services to specific extensions

Basic Authentication module

Handlers ISAPI handler (.dll)

Compression module (etc)

Static handler (.htm, .jpg, .gif,  etc)

 

IIS 7 pipeline allows native and managed modules and handlers

  • “Integrated” Application Pool mode
    • use the managed modules and handlers
    • ASP.NET v2.0 and above can be configured to run in Integrated Mode
  • “Classic” Application Pool
    • IIS 6 style invocation of .NET
    • ASP.NET v1.1 and earlier can only be configured to run in Classic Mode

Building Managed Modules and Handlers

Modules – Building a Module to cause IIS to Log to SQL Server

The steps to build a module are more or less:

  • Add a class to your project – e.g.  public class SqlLogModule: IHttpModule
  • Edit the code!
    • Add to public void Init()
      context.LodgRequest += new EventHandler(OnLogRequest)
    • Fill in OnLogRequest
      HttpApplication app = (HttpApplication) sender;
      Log(app.Context); // TODO: write this function! :)
  • IIS Manager -> Configure Modules -> Managed Modules
    • Add Managed Module
      • Name "SqlLogModule"
      • Type "SqlLogModule"
        This adds web.config to our project!
  • Edit web.config <system.webServer> section. ASP.NET ignores this section; it’s only read by IIS7.

[Side question: how is all this possible? Won’t ASP.NET 2.0 keel over at this point? Answer: no, .NET v2.0 was refactored for Vista and Server 2008.] 

Filed Under: TechEd Tagged With: ASP.NET, IIS Pipeline, TechEd 2007

« Previous Page

Joel is a full-stack cloud architect who codes. He is a Microsoft Certified SharePoint Online, SharePoint Server and Azure specialist and Microsoft Certified Trainer.
He has over 20 years' experience with SharePoint and the Microsoft .NET Framework.
He's also co-founder of Microsoft Gold Partner JFDI Consulting Ltd. Read More…

Recent Posts

  • Microsoft Flow Tip #1 – Word Templates and Hiding Empty Repeating Sections
  • SharePoint PowerShell Tip #1 – Select-Object and FieldValues
  • Popular Misconceptions – Microsoft Teams relationship with SharePoint
  • Course: Microsoft 365 Certified Teamwork Administrator
  • Audience Targeted Searches in Modern SharePoint Online
MCT 2020-2021
Microsoft Teamwork Administrator Associate
Joel's Acclaim Profile
Joel's Microsoft Profile

Tags

Administration Architecture Certification Cloud Development freetraining Information Architecture intranets MCP Microsoft Microsoft Architecture Microsoft Azure microsoftsharepoint migration Mobile Development MOSS Office 365 office365 Office 365 Permissions PowerShell SaaS SharePoint SharePoint 2010 SharePoint 2010 Training SharePoint 2013 SharePoint Administration SharePoint Administrator SharePoint Architecture SharePoint Developer SharePoint Development sharepointia SharePoint Online sharepointonline SharePoint Search SharePoint Training SharePoint Videos Silverlight SOA SPThingADay TechEd 2007 Training Videos Windows Phone 7 WSS

Copyright © 2022 Joel Jeffery, SharePoint Architect