Operation Not Supported on This Platform When Consuming WCF Service in .NET 8

danr 471996 0 Reputation points
2025-04-10T15:58:46.18+00:00

untering the error "Operation not supported on this platform" while attempting to consume a WCF service from .NET 8. The service is built in .NET Framework with wsHttp security. The implementation involves passing a username, password, and a certificate, yet the operation fails.

Is there a method to successfully consume services with this type of security? Various approaches have been explored without success.

The code in use is as follows:

var wsHttpBindingWithCredential = new WSHttpBinding();
wsHttpBindingWithCredential.Security.Mode = SecurityMode.Message;
wsHttpBindingWithCredential.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
wsHttpBindingWithCredential.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
wsHttpBindingWithCredential.Security.Message.EstablishSecurityContext = false; 
var endpoint = new EndpointAddress("http://serviciotimbrefiscalprueba.dgi.gob.ni/TimbreFiscalDigital.svc");
var svctestclient = new TimbreFiscalDigitalClient(wsHttpBindingWithCredential, endpoint);
svctestclient.ClientCredentials.UserName.UserName = identity.user;
svctestclient.ClientCredentials.UserName.Password = identity.password;
svctestclient.Endpoint.Binding.SendTimeout = TimeSpan.FromMinutes(5);
svctestclient.Endpoint.Binding.ReceiveTimeout = TimeSpan.FromMinutes(5);
var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly);
var certs = store.Certificates.Find(
    X509FindType.FindBySubjectName,
    "timbrefiscal.dgi.gob.ni",
    validOnly: false
);
if (certs.Count == 0)
{
    throw new Exception("Certificate not found");
}
     
var clientCertificate = certs[0];
store.Close();
svctestclient.ClientCredentials.ClientCertificate.Certificate = clientCertificate;
svctestclient.Open();
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
414 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 74,936 Reputation points
    2025-04-11T15:47:08.4433333+00:00

    the .net core version of WCF is an open source project and only a subset of WCF:

    https://github.com/CoreWCF/CoreWCF

    you could check the issues.

    note: MS recommends changing technology, say to gRPC.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.