title: WCF: method that returns void causes "The server did not provide a meaningful reply" error on client
body: <p>I'm getting the following error on the client when I have aspNetCompatibilityEnabled="true" and a service method that returns void.  Adding a non-void return value to the method makes the error go away.  Turning off aspnet compatibility also makes the problem go away. </p>
  
  <pre><code>The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
  </code></pre>
  
  <p>My website's web config contains the following:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /&gt;
  
      &lt;behaviors&gt;
          &lt;serviceBehaviors&gt;
              &lt;behavior name=""&gt;
                  &lt;serviceMetadata httpGetEnabled="true" /&gt;
                  &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
              &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
  
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Does anyone have any thoughts on why this might be happening?  If not, does anyone know of ways to turn on additional logging or tracing that might be able to help?  How can I tell if it is a "premature session shutdown"?</p>
  
  <p>The server side code does execute without error.  This problem happens somewhere between the service method completing and the response arriving back at the client.</p>
  
  <p>Please do not suggest turning off aspnet compatibility as the solution.  I need to the able to access HttpContext.Current within my services for various reasons. </p>