Has anyone seen any how-to, documentation, or otherwise about how to load HTTP Modules dynamically for IIS?
有没有人看到任何关于如何动态加载HTTP模块的方法,文档或其他方法?
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.
基本上我要做的是加载HTTP模块,我称之为HTTPModuleA,HTTPModuleB和HTTPModuleC。但是,可以随时使用HTTPModuleD,HTTPModuleE或HTTPModuleF更改模块。我基本上想把它们放在配置文件中,但不想有引用或任何东西。我希望能够只将它们放入特定的路径(程序集的dll),设置文件/路径的配置文件条目,并拥有Unity,或者其他框架只是选择它们加载他们。可能每2-3分钟扫描一次更改。
Any notions on how to get this done are much appreciated. Thx!
任何关于如何完成这一任务的想法都非常感谢。谢谢!
2 个解决方案
#1
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.
Unity不是动态加载模块的方法。您可以查看Microsoft扩展性框架以动态加载模块,我听说这很棒。
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
我个人建立了一个类似的系统,并在CodeProject上使用了一篇文章作为指导,但我现在找不到它。我确实找到了这个(类似的)并展示了如何使用比每2或3分钟轮询更好的文件观察器:http://www.codeproject.com/KB/cs/dynamicpluginmanager.aspx
#2
You can drop assemblies in the /bin directory and have ASP.NET load a module without ever referencing the assemblies in your web application.
您可以删除/ bin目录中的程序集,并让ASP.NET加载模块,而无需引用Web应用程序中的程序集。
#1
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.
Unity不是动态加载模块的方法。您可以查看Microsoft扩展性框架以动态加载模块,我听说这很棒。
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
我个人建立了一个类似的系统,并在CodeProject上使用了一篇文章作为指导,但我现在找不到它。我确实找到了这个(类似的)并展示了如何使用比每2或3分钟轮询更好的文件观察器:http://www.codeproject.com/KB/cs/dynamicpluginmanager.aspx
#2
You can drop assemblies in the /bin directory and have ASP.NET load a module without ever referencing the assemblies in your web application.
您可以删除/ bin目录中的程序集,并让ASP.NET加载模块,而无需引用Web应用程序中的程序集。