Thursday, January 22, 2015

Custom Http Module runs only with Integrated Pipeline mode on IIS application pool

When you write custom HTTP module in your .Net Application to run custom code at the application start event, you have to set the Application pipeline to Integrated Mode so that the application can see your custom HTTP module in the IIS and run it.
The problem rises when you publish MVC web application on the IIS with pipeline mode Classic, then you will see the error:

Error: An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.


To solve this problem, and keep your custom Http Module working correctly, then you may edit the web.config file with the following attribute.


       
   
 <configuration>  
   <system.webServer>  
     <validation validateIntegratedModeConfiguration="false"/>  
   </system.webServer>  
 </configuration>