您的位置:首页 > 理论基础 > 计算机网络

IIS7 里注册HttpModule和IIS6 里注册时候 在WEB.CONFIG里有所不同

2013-06-01 15:47 357 查看
Theonlyweirdparthereisgettingahandletothelogger.I’musinganIoCcontainerinmyapplication,howeverIcan’ttellIIShowtobuildupmyRequestDurationLoggerModule,soI’mstuckusingtheServiceLocatorpattern.Thecontainercouldbeasingleton,butIdon’tlikesingletons,soIimplementedIServiceProviderinGlobal.asaxinstead.Allthat’sleftnowiswiringinthemodule.SinceCassinibehaveslikeIIS6,youhavetousethelegacystyleconfiguration,whichlookslikethis:

<system.web>

<httpModules>

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

</httpModules>

</system.web>



ForIIS7though,youadditlikethis:

<system.webServer>

<modules>

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

</modules>

</system.webServer>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐