title: Net Core WCF error "One or more errors occurred. (There was no endpoint listening at"
body: <p>I am calling an external soap service. In development it works fine, but publishing it on the server throws the indicated error.</p>
  
  <p>"One or more errors occurred. (There was no endpoint listening at that <a href="https://myservice" rel="nofollow noreferrer">https://myservice</a> could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.)"</p>
  
  <p>If I refresh the page the error changes:</p>
  
  <p>An unhandled exception occurred while processing the request.
  AggregateException: One or more errors occurred. (Object is read-only.)
  System.Threading.Tasks.Task.GetResultCore(bool waitCompletionNotification)</p>
  
  <p>InvalidOperationException: Object is read-only.
  System.ServiceModel.Security.X509CertificateRecipientClientCredential.ThrowIfImmutable()</p>
  
  <p>This is the code:</p>
  
  <pre><code>            PortTypeClient.ClientCredentials.ServiceCertificate.SslCertificateAuthentication= new X509ServiceCertificateAuthentication()
              {
                  CertificateValidationMode = X509CertificateValidationMode.None,
                  RevocationMode = X509RevocationMode.NoCheck
              };
  </code></pre>