Dynamically Loading Custom Http Modules

Discussion in 'ASP .Net' started by Cramer, Apr 4, 2008.

  1. Cramer

    Cramer Guest

    Here is what I plan to do (the question follows the description):

    My intent is to have a custom HTTP module dynamically determine which
    classes should handle various pipeline events. We'll call this the "loader
    module". The loader module then (1) loads the assemblies that house the
    other classes, instantiating the requisite object; then (2) wires up the
    requisite pipeline event to the corresponding event handling method of the
    class instantiated from the dynamically loaded assembly.

    The idea here is that I can, for example, have a few different classes (each
    in its own assembly) that can handle specific HTTP pipeline events (like
    BeginRequest or AuthenticateRequest) - and then have one of those classes
    process that event during all future requests. This would allow me to have,
    for example, multiple custom authentication mechanisms - each implemented in
    its own class and assembly, one of which is then plugged into the
    application by my custom HTTP module.

    My question:
    Will this even work? FWIW: I know how to dynamically load assemblies and
    instantiate classes from them. I'm just not understanding the mechanism in
    ASP.NET that would call my custom HTTP module (the "loader module") - which
    needs to be called only once; yet call the dynamically loaded Request
    processing module(s) for every single request (to handle, for example, the
    AuthenticateRequest event).

    Cramer, Apr 4, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.