title: WCF Unit Testing Results in a System.ServiceModel.FaultException
body: <p>So I have a WCF service that seems to work perfectly in a deployed production environment.  My build intermittently fails though during the unit testing of this WCF service.  The weird part is that it's not always the same unit test, but it is always a unit test which uses the WCF service.</p>
  
  <p>Exception:</p>
  
  <pre><code>System.ServiceModel.FaultException[System.ServiceModel.ExceptionDetail]: The number of bytes available is inconsistent with the HTTP Content-Length header.  There may have been a network error or the client may be sending invalid requests.
  </code></pre>
  
  <p>The weird part is that the exception really only happens on the build machine and never on a developer machine.  And it seems to only happen about 75% of the time.</p>
  
  <p>WCF isn't my strongest aspect of .NET so any help pointing me in the correct direction would be useful.</p>