Elmah does not register or read errors through iis 7.5 express

So, I don’t know if anyone else is experiencing this, but if I run asp.net with ELMAH installed through IIS 7.5 Express, ELMAH refuses to register or even read from the database. If I instead launch the site through Cassini, all is well. Elma works like a charm ...

Anyone else having this problem?

+4
source share
1 answer

Based on what you have described so far, the only explanation I can come up with is that the ELMAH modules and handler may have only been registered with <system.web> , which is why they are used in ASP.NET Development Server (Cassini). On the other hand, IIS Express expects these modules and the handler to be registered in <system.webServer> . The following is an excerpt from the web.config sample shipped with ELMAH 1.1 :

 <!-- The <system.webServer> section is required for running ELMAH under Internet Information Services 7.0. It is not necessary for previous version of IIS. In general, it would be best to include it for all .NET Framework 2.0 and above configurations in order to have a more portable solution between various versions of IIS. IIS 5.x, IIS 6 require the modules and handlers to be declared in <system.web> whereas IIS 7 needs them declared here and complains if they are in fact declared in <system.web>. Fortunately, the <validation validateIntegratedModeConfiguration="false" /> entry tells IIS 7 not to worry about the modules and handlers declared in <system.web>. If you only ever want to use IIS 7, then do the following: 1. Remove handlers and modules from <system.web> 2. Remove the <validation validateIntegratedModeConfiguration="false" /> element --> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules> <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" /> <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" /> <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" /> <add name="ErrorTweet" type="Elmah.ErrorTweetModule, Elmah" preCondition="managedHandler" /> </modules> <handlers> <add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" /> </handlers> </system.webServer> 
+5
source

Source: https://habr.com/ru/post/1336708/


All Articles