Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I don't want to receive emails about
"The wait operation timed out"
error
what is wrong in my code? because I still getting emails about this error

What I have tried:

my config file
<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
<configSections>
    <sectionGroup name="elmah">
      <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/>
      <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
      <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
      <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/>
    </sectionGroup>
  </configSections>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <add name="Elmah.ErrorLog" type="Elmah.ErrorLogModule, Elmah" 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>
  
  
  
  <elmah>
    <security allowRemoteAccess="0" />

  
    <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/SiteData/ErrorLog" />
 
 <errorMail from="xxx"
  to="xxx"
  subject="Error"
  async="true"
  smtpPort="26"
           smtpServer="xxx"
           userName="xxx"
           password="xxx"> 
   </errorMail>
 </elmah>
  
  <location path="elmah.axd">
    <system.web>
      <authorization>
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
 
  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
    
    <httpRuntime maxRequestLength="20480" executionTimeout="1800"/>
<httpHandlers>
      <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
    </httpHandlers>

    <httpModules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
  </httpModules>  
</system.web>
  
  <appSettings>
    <add key="aspnet:MaxHttpCollectionKeys" value="5000"></add>
  </appSettings>

</configuration>


code in Global.asax
C#
void ErrorMail_Filtering(object sender, ExceptionFilterEventArgs e)
        {
            if (e.Exception.Message.Contains("The wait operation timed out"))
                e.Dismiss();
        }
Posted
Comments
Bryian Tan 4-May-17 10:35am    
Have you try e.Exception.InnerException.Message
M. Daban 4-May-17 18:26pm    
I will try it
M. Daban 5-May-17 20:14pm    
doesn't work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900