title: WCF service client with cert auth, works when debug, but not live
body: <p>Im using a certificate authenticated WCF service. I works when in VS debugmode, but when i publish and run it won't work. </p>
  
  <p>The cerificatesd are stored in CurrentUser/TrustedPeople.
  This is my config behavior-section:</p>
  
  <pre><code>&lt;behavior name="LoadClientCert"&gt;
      &lt;clientCredentials&gt;
          &lt;clientCertificate findValue="CN=Certificate1"
                          storeLocation="CurrentUser" storeName="TrustedPeople"
                          x509FindType="FindBySubjectDistinguishedName" /&gt;
          &lt;serviceCertificate&gt;
            &lt;defaultCertificate findValue="CN=Certificate2"
                          storeLocation="CurrentUser" storeName="TrustedPeople"
                          x509FindType="FindBySubjectDistinguishedName" /&gt;
            &lt;authentication certificateValidationMode="None"
                          revocationMode="NoCheck" /&gt;
          &lt;/serviceCertificate&gt;
        &lt;/clientCredentials&gt;
  &lt;/behavior&gt;
  </code></pre>
  
  <p>Error message: <em>Request Error
  The server encountered an error processing the request. See server logs for more details.</em></p>
  
  <p>My guess is  that the IIS user don't have permissions to use the certificate. But that is only guessing.</p>
  
  <p>And where can i find that server log? i tried event viewer but i didn't find anything. I also added this to my config without luck(its empty after trying the solution):</p>
  
  <pre><code>&lt;system.diagnostics&gt;
  &lt;sources&gt;
    &lt;source name="System.ServiceModel.MessageLogging"&gt;
      &lt;listeners&gt;
               &lt;add name="messages"
               type="System.Diagnostics.XmlWriterTraceListener"
               initializeData="f:\logs\messages.svclog" /&gt;
        &lt;/listeners&gt;
    &lt;/source&gt;
  &lt;/sources&gt;
  &lt;/system.diagnostics&gt;
  &lt;diagnostics&gt;
  &lt;messageLogging 
       logEntireMessage="true" 
       logMalformedMessages="false"
       logMessagesAtServiceLevel="true" 
       logMessagesAtTransportLevel="false"
       maxMessagesToLog="3000"
       maxSizeOfMessageToLog="2000"/&gt;
  &lt;/diagnostics&gt;
  </code></pre>
  
  <p>Any suggestions?</p>