Sep 13 2007

HttpModules and IIS 7

When working with an ASP.NET Web Application under Vista/IIS 7 and developing an HttpModule, watch out for the Application pool you are using. If your application is configured to work with classic application pool, then it is enough to define the module within the httpModules section as:

<httpModules>
       <add name="MyModule" type="MyModule" />
</httpModules>

If however, you have configured your web application to work with Default Application Pool (i.e. integrated mode), then you should add another entry to your web.config file as follows:

    <!--
  The system.webServer section is required for running ASP.NET AJAX under Internet
  Information Services 7.0. It is not necessary for previous version of IIS.
 -->
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules>
                <add name="MyModule" preCondition="integratedMode" type="MyModule" />
        </modules>
    </system.webServer> 

 

Thanks for my friend Wessam for hinting this to me!!
Regards 

 

Tags: , ,

Comments are closed