KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Just spent a lot of time sifting through contradictory advice on this problem, and thought I'd post my solution. My environment is .NET 4.5, Visual Studio 2012, working on an MVC 4 application. I created an Http Module like I'd done in the past, and added it to Web.config like so: <configuration> <system.web> <httpModules> <add name="MyModule" type="Services.MyModule, Services" /> </httpModules> </system.web> </configuration> However, the application never called the module's Init(). Eventually, I found advice that the modules should instead be inside <system.webServer> , and the element named <modules> instead of <httpModules> , like so: <configuration> <system.webServer> <modules> <add name="MyModule" type="MyModule" type="Services.MyModule, Services" /> </modules> </system.webServer> </configuration> Re-ran the application, and it called Init() as expected. FWIW, the page with the direction is here: http://msdn.microsoft.com/en-us/library/ms227673.aspx HTH
Tags (comma-separated)
Save Edits
Cancel