When registering httpmodule in iis7 and IIS6, they are different in Web. config.

Source: Internet
Author: User

The only weird part here is getting a handle to the logger. i'm using an IOC container in my application, however I can't tell IIS how to build up my requestdurationloggermodule, so I'm stuck using the service locator pattern. the container cocould be a Singleton, but I don't like singletons, So I implemented iserviceprovider in global. asax instead. all that's left now is wiring in the module. since Cassini behaves like IIS6, you have to use the legacy style configuration, which looks like this:

  <system.web>
    
      <addname="..."type="MyApplication.RequestDurationLoggerModule, MyApplication"/>
    
  </system.web>
 

For iis7 though, you add it like this:

  <system.webServer>
    <modules>
      <addname="..."type="MyApplication.RequestDurationLoggerModule, MyApplication"/>
    </modules>
  </system.webServer>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.