ASP.NET: What does this HttpModule do? System.ServiceModel.Activation.HttpModule

后端 未结 3 1817
名媛妹妹
名媛妹妹 2021-01-12 02:45

Can anyone tell me the purpose of this HttpModule? It\'s showing up on my HttpModuleCollection list, but I don\'t know what\'s it\'s for.

System.ServiceMode         


        
3条回答
  •  终归单人心
    2021-01-12 03:25

    System.ServiceModel.Activation.HttpModule come from because you installed "Microsoft .NET Framework 3.5.1" / "Windows Communication Foundation HTTP Activation" feature. If you don't need the feature you can uninstall it of remove the module from your web.config. The less unused modules you load the more quickly run your web application.

    If you install this feature after the installation of .NET 4 framework on your server you can receive problems described in http://blogs.iis.net/webtopics/archive/2010/04/28/system-typeloadexception-for-system-servicemodel-activation-httpmodule-in-asp-net-4.aspx.

    In general an HTTP module is called on every request in response to the BeginRequest() and EndRequest() events. As a result, the module runs before and after a request is processed. In the section "How HTTP Modules Work" on http://msdn.microsoft.com/en-us/library/bb398986(v=VS.100).aspx you can read more about HTTP modules.

    http://msdn.microsoft.com/en-us/library/ms227673.aspx describes how to create a Custom HTTP Module. Some small custom modules can be really helpful. For example, you can read in How to remove the ".svc" extension in RESTful WCF service? a code example (which originate from the book "RESTful .NET", Chapter 5, page 96) "Removing the .SVC Extension from WCF REST URLs". In http://www.west-wind.com/weblog/posts/570695.aspx you can read how to do the same with respect of "IIS 7 Rewrite Module".

    The general information about HTTP module is not a part of your question, but I inserted it to better understanding what Activation.HttpModule do, and what other more useful modules you can use or write yourself.

提交回复
热议问题