Search code examples
asp.net-mvciis-7castle-windsor

Looks like you forgot to register the http module with Windsor Castle with IIS7


I am using windsor DI framework in one of my MVC project. The project works fine when I tried to run from Visual Studio 2008.

But when i tried to run the project creating an application in IIS7 then I recieved the following error message:

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

But this module already exists in the httpmodule section of web.config file.

Does anyone know what I have to do to eliminate this problem.


Solution

  • Try adding it to the system.webServer section as well?

    <configuration>
        <system.web>
            <httpModules>
                <add name="PerRequestLifestyle" type="..." />
            </httpModules>
        </system.web>
        <system.webServer>
            <modules>
                <add name="PerRequestLifestyle" type="..." />
            </modules>
        </system.webServer>
    </configuration>