Dynamically adding HttpModules and HttpHandlers

Is adding / removing HttpModules and HttpHandlers at runtime from a website a good idea? I’m considering ways to make my site as dynamic as possible without downloading the changed content over and over again. Something like configuration files. Rules mechanisms exist, but learning them seems a pain. Maybe I'm wrong in my perspective. Please suggest possible ways to change the logic in the code at runtime.

+3
source share
3 answers

One possible way is to create a common HTTPHandlerFactory, which in turn returns the requested handlers.

Read more about the link for clarity.

+1

ASP.NET 4 PreApplicationStartMethod, HttpModules.

http://www.nikhilk.net/Config-Free-HttpModule-Registration.aspx.

, HttpApplication, HttpModules , , HttpApplication .

+7

.NET4 :

HttpHandler HttpModule . . : HttpHandler .NET?

http-:

Microsoft.Web.Infrastructure installation package

Install-Package WebActivator

[assembly: PreApplicationStartMethod(typeof(MyPreStartClass), "Start")]

namespace .....
{
    public static class MyPreStartClass
    {
        public static void Start()
        {
            DynamicModuleUtility.RegisterModule(typeof(FooHttpModule));
        }
    }
}
+4
source

Source: https://habr.com/ru/post/1738610/


All Articles