我在我的一个MVC项目中使用windsor DI框架。该项目工作正常,当我试图从Visual Studio 2008运行。
但是当我试图运行该项目在IIS7中创建一个应用程序,然后我收到以下错误信息:
Looks like you forgot to register the http module
Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule Add ‘<add
name=”PerRequestLifestyle”
type=”Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule,
Castle.MicroKernel” />’ to the section on your
web.config
但是这个模块已经存在于web.config文件的httpmodule部分。
有谁知道我必须做什么来消除这个问题。
解决方法
尝试将它添加到system.webServer部分?
<configuration> <system.web> <httpModules> <add name="PerRequestLifestyle" type="..." /> </httpModules> </system.web> <system.webServer> <modules> <add name="PerRequestLifestyle" type="..." /> </modules> </system.webServer> </configuration>