title: why WCF service stop working every 20 mins?
body: <p>I am newbie of wcf and mulit-thread, and I write a wcf service hosted in IIS7, in this service there is a long running task (System.Threading.Tasks.Task) which will probably be going to run 20 hours. </p>
  
  <p>But this wcf service always stops to work every 20 minutes. </p>
  
  <p>I make the wcf send email to me when application_stop and application_start is running. Therefore, I receive a email when it start run, and then after 20 minutes, I receive the email show that the service stop.</p>
  
  <p><strong>I really cannot figure out why this happen, why the service stop work every 20 minutes.</strong></p>
  
  <p><strong>Does the wcf services stop every 20 minutes, or the Task thread stop every 20 minutes?</strong></p>
  
  <p><strong>Will any configuration of IIS7 impact wcf running time?</strong></p>
  
  <p>I try to set the receiveTimeout to a every large time amount, and I use asych call to invoke wcf in client side, but this does not make help.</p>
  
  <p>Guys, I really need help, many thanks.</p>
  
  <p>Following code belongs to a website which calls this wcf service</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="BasicHttpBinding_IMailingService" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="24.20:31:23.6470000" sendTimeout="00:01:00"
            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
            useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None"
                realm="" /&gt;
              &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="http://localhost:92/MailingService.svc" binding="basicHttpBinding"
          bindingConfiguration="BasicHttpBinding_IMailingService" contract="MalingService.IMailingService"
          name="BasicHttpBinding_IMailingService" /&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>