首页 新闻 会员 周边

使用 Castle.winsdor 注册为 LifestylePerWebRequest 每Web请求时报错

0
悬赏园豆:20 [待解决问题]

1、运行时,提示错误:

Looks like you forgot to register the http module Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule
To fix this add
<add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor" />
to the <httpModules> section on your web.config.

 

2、我已经按照这里的提示改写了 web.config,但是还是不好使。

网址:http://stackoverflow.com/questions/258011/looks-like-you-forgot-to-register-the-http-module-with-windsor-castle-with-iis7

<system.web>
  <httpModules>
      <add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor" />
  </httpModules>
</system.web>  
<system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>
  <modules runAllManagedModulesForAllRequests="true">
    <remove name="PerRequestLifestyle"/>
    <add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor"/>
  </modules>
</system.webServer>

3、哦,我使用的框架是Abp,应该是支持 LifestylePerWebRequest 吧?

十分感谢!

东至的主页 东至 | 初学一级 | 园豆:16
提问于:2016-04-07 06:52
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册