Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxx0cm, www.webdp.net, Event 9 IIS log failed to write entry, wwwxxx jeffs, Catastrophic failure Unexpected method call sequence. 0x8000ffff (-2147418113)., ksh lock a file, [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed, sed: -e expression #1, char 1: unterminated address regex, procmail + change subject, w2ksp4.exe download

Links

XODOX
Impressum

#1: Programmatically (not declaratively) Configuring the Request Pipeline in IIS 7

Posted on 2008-04-18 18:13:36 by Peter Schwartz

In IIS5.1 and 6, if I wanted to customize the request pipeline for an
ASP.NET application, I would run some logic during Application_Start that
wired up various event handling methods to the various pipeline events.

But things are different with IIS 7. In IIS 7, the ASP.NET request
processing pipeline overlays the IIS pipeline directly, essentially
providing a wrapper over it instead of plugging into it (as was the case
with IIS 5.1 and 6).

My question: How can I *programmatically* wire up ASP.NET event handling
methods to handle the various pipeline events (of this new "combined"
request pipeline)? Please note that I am perfectly clear on how to
*declaratively* configure the pipeline (via .config files).

My situation is that I must hit a database to determine how to configure the
request pipeline - specifically to hook up a custom authentication module as
well as another module that does some "non standard" processing whenever an
ASP.NET Web application first starts (e.g., upon the first, and only the
first, request after it's app pool is recycled). In the "old world" I would
do this activity during Application_Start of the ASP.NET application. I
don't know what the equivalent would be in the "new world" of IIS7.

Thanks.

Report this message

#2: Re: Programmatically (not declaratively) Configuring the Request

Posted on 2008-04-21 21:13:15 by David Wang

On Apr 18, 9:13=A0am, "Jordan S." <A...@B.com> wrote:
> In IIS5.1 and 6, if I wanted to customize the request pipeline for an
> ASP.NET application, I would run some logic during Application_Start that
> wired up various event handling methods to the various pipeline events.
>
> But things are different with IIS 7. In IIS 7, the ASP.NET request
> processing pipeline overlays the IIS pipeline directly, essentially
> providing a wrapper over it instead of plugging into it (as was the case
> with IIS 5.1 and 6).
>
> My question: How can I *programmatically* wire up ASP.NET event handling
> methods to handle the various pipeline events (of this new "combined"
> request pipeline)? Please note that I am perfectly clear on how to
> *declaratively* configure the pipeline (via .config files).
>
> My situation is that I must hit a database to determine how to configure t=
he
> request pipeline - specifically to hook up a custom authentication module =
as
> well as another module that does some "non standard" processing whenever a=
n
> ASP.NET Web application first starts (e.g., upon the first, and only the
> first, request after it's app pool is recycled). In the "old world" I woul=
d
> do this activity during Application_Start of the ASP.NET application. I
> don't know what the equivalent would be in the "new world" of IIS7.
>
> Thanks.


You can programmatically wire which events a module will subscribe on
a given request, in both native and managed code. You cannot
programmatically add/remove modules on a given request, on the fly.

And for the "non standard" processing -- it sounds like you have a
singleton init design pattern, which is really not tied to
"Application_Start".

Regarding event timing -- it is not a good idea to expect certain
ordering or frequency of events between IIS7 managed module and
ASP.Net HttpModule -- those are some of the very things that we
changed (out of necessity) in integrating the event pipelines
together.

I don't see why you cannot use BeginRequest to accomplish what you
need.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//

Report this message