title: Service Certificate WCF Service
body: <p>I encountered a problem whereby the WCF Service Host does not detect the existence of the service certificate that is needed to host a WCF service.</p>
  <p><strong>System.InvalidOperationException: The service certificate is not provided. Specify a service certificate in ServiceCredentials.</strong></p>
  <p>Service Config</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;configuration&gt;
    &lt;system.serviceModel&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name=&quot;announcementBehavior&quot;&gt;
        &lt;!--The following behavior attribute is required to enable WCF serialization of large data sets --&gt;
        &lt;dataContractSerializer maxItemsInObjectGraph=&quot;2147483647&quot;/&gt;
        &lt;serviceDiscovery&gt;
          &lt;announcementEndpoints&gt;
            &lt;endpoint kind=&quot;announcementEndpoint&quot;
          address=&quot;net.tcp://localhost:8005/Announcement&quot;
          binding=&quot;netTcpBinding&quot;
          bindingConfiguration=&quot;RequestReplyNetTcpBinding&quot;/&gt;
          &lt;/announcementEndpoints&gt;
        &lt;/serviceDiscovery&gt;
        &lt;serviceThrottling
                maxConcurrentCalls=&quot;1500&quot;
                maxConcurrentSessions=&quot;1500&quot;
                maxConcurrentInstances=&quot;1500&quot;/&gt;
        &lt;serviceCredentials&gt;
          &lt;serviceCertificate findValue=&quot;WCFServer&quot;
                              storeLocation=&quot;LocalMachine&quot;
                              storeName=&quot;TrustedPeople&quot;
                              x509FindType=&quot;FindBySubjectName&quot; /&gt;
          &lt;clientCertificate&gt;
            &lt;authentication certificateValidationMode=&quot;PeerTrust&quot; trustedStoreLocation=&quot;LocalMachine&quot; revocationMode=&quot;NoCheck&quot;/&gt;
          &lt;/clientCertificate&gt;
        &lt;/serviceCredentials&gt;
      &lt;/behavior&gt;
   &lt;/serviceBehaviors&gt;  
   &lt;/behaviors&gt; 
   &lt;service name=&quot;Test2ServLib.IService1&quot;
     behaviorConfiguration=&quot;announcementBehavior&quot;&gt;
      &lt;host&gt;
        &lt;baseAddresses&gt;
          &lt;add baseAddress=&quot;net.tcp://localhost:8006/Service1&quot;/&gt;
        &lt;/baseAddresses&gt;
      &lt;/host&gt;
      &lt;endpoint binding=&quot;netTcpBinding&quot;
                bindingConfiguration=&quot;RequestReplyNetTcpBinding&quot;
                contract=&quot;Test2ServLib.IService1&quot;
                behaviorConfiguration=&quot;LargeEndpointBehavior&quot; /&gt;
          &lt;bindings&gt;  
              &lt;netTcpBinding&gt;  
                  &lt;binding name = &quot;RequestReplyNetTcpBinding&quot;&gt;  
                      &lt;security&gt;  
                          &lt;message clientCredentialType=&quot;Certificate&quot; /&gt;  
                      &lt;/security&gt;  
                  &lt;/binding&gt;  
              &lt;/netTcpBinding&gt;  
          &lt;/bindings&gt;  
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>