Home > Software engineering >  WCF client migration to .NET 6
WCF client migration to .NET 6

Time:09-09

I am trying to migrate my WCF client from .NET Framework to .NET 6 using the CoreWCF package.

I have this binding configuration in old project:

<binding name="CustomBinding_IService">
    <security 
        defaultAlgorithmSuite="Basic128" 
        authenticationMode="Kerberos" 
        requireDerivedKeys="true" 
        includeTimestamp="true" 
        messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" 
        requireSignatureConfirmation="false">
        <localClientSettings detectReplays="true"/>
        <localServiceSettings detectReplays="true"/>
    </security>
    <binaryMessageEncoding/>
    <httpTransport 
         maxReceivedMessageSize="2147483647" 
         maxBufferSize="2147483647" 
         maxBufferPoolSize="2147483647"/>
</binding>

And this endpoint configuration:

<endpoint 
    address="https://my-address/Service.svc" 
    binding="customBinding" 
    bindingConfiguration="CustomBinding_IService" 
    contract="TestClient.IService" 
    name="CustomBinding_IService">
    <identity>
        <servicePrincipalName value="host/test"/>
    </identity>
</endpoint>

When I tried to specify this SPN I got an error that it is not supported. Is it possible to to implement such a client configuration in .NET 6 at all?

CodePudding user response:

For client configuration, try using CoreWCF.

As of April 2022, CoreWCF has been supported by Microsoft, but it is not fully functional, only supports some features of WCF and requires code modification in the original.NET framework to be tested successfully.

As an alternative to WCF, I think you could consider gRPC.

CodePudding user response:

WCF on .NET 6 requires different NuGet-packages for the client and the service.

However, as far as I know, the client cannot use the config-file to define the endpoint. (The service does, with the CoreWCF.ConfigurationManager package). So the CoreWCF client has to be defined in C# code.

  • Related