Search code examples
iisdynamicdependency-injectionhttpmodule

Dynamically Load HTTP Modules, Possibly with Unity?


Has anyone seen any how-to, documentation, or otherwise about how to load HTTP Modules dynamically for IIS?

Basically what I am trying to do is to load HTTP Modules, which I'll call HTTPModuleA, HTTPModuleB, and HTTPModuleC. The modules however could be changed out at any time with HTTPModuleD, HTTPModuleE, or HTTPModuleF. I basically would like to put them in the config file, but don't want to have references or anything. I'd like to be able to merely have them dropped into a particular path (the dll of the assembly that is), set the config file entry for the file/path, and have Unity, or something other framework just pick them up and load them. Possibly scanning for changes every 2-3 minutes or something.

Any notions on how to get this done are much appreciated. Thx!


Solution

  • Unity is NOT a way to dynamically load modules. You could look at the Microsoft Extensibility Framework to dynamically load modules, which I hear is great.

    Personally I built a similar system and used an article on CodeProject for guideance, but I can't find it now. I did find this (which is similar) and shows how to use the file watcher which is nicer than polling every 2 or 3 min: http://www.codeproject.com/KB/cs/dynamicpluginmanager.aspx