Wednesday, 15 September 2010

Elmah Configuration with IIS 7

There are importent differences when using with IIS6 & 7
<system.webServer>
 <!-- 
        IIS5x, IIS6 requires the modules and handlers to be declared in <system.web> 
        IIS7 needs them declared here and moans if they are declared in <system.web>!! 
        Fortunately, <validation validateIntegratedModeConfiguration="false" /> tells 
        IIS7 not to worry about the modules and handlers declared in <system.web>!! 
        If you only ever want to use IIS7, then do the following: 
        1) remove handlers and modules from <system.web> 
        2) remove the <validation validateIntegratedModeConfiguration="false" /> line 
    -->
 <validation
  validateIntegratedModeConfiguration="false" />
 <modules>
  <add
   name="Elmah.ErrorLog"   type="Elmah.ErrorLogModule, Elmah"   preCondition="managedHandler" />
  <add
   name="Elmah.ErrorFilter"   type="Elmah.ErrorFilterModule"   preCondition="managedHandler" />
  <add
   name="Elmah.ErrorMail"   type="Elmah.ErrorMailModule"   preCondition="managedHandler" />
 </modules>
 <handlers>
  <add
   name="Elmah"   path="elmah.axd"   verb="POST,GET,HEAD"   type="Elmah.ErrorLogPageFactory, Elmah"   preCondition="integratedMode" />
 </handlers>
</system.webServer>

No comments:

Post a Comment