.Net Core to support Web.config

Mohan Rosh 1 Reputation point
2021-07-27T07:13:41.483+00:00

My application consume WCF service. The Service call is fully configured in my app.config file (Address, Contract, EndPoint, behaviour etc) . My application and WCF service running in .net 4.6 and its working hand to hand

Now we are planning to upgrade our application to .NET CORE. Since my WCF service communication is configured in XML config file (app.config) and .NET CORE accepts json configuration only, how I communicate with WCF service without change in my .net code

Is there any way configuration can set up in old way (XML configuration)

Developer technologies | .NET | .NET Runtime
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 82,316 Reputation points Volunteer Moderator
    2021-07-27T15:14:19.13+00:00

    As wcf was not ported to .net core, you will need to do code changes. Microsoft suggests switching gRPC instead.

    Microsoft did create a new svcutil which will generate code proxy for an existing wcf service.

    https://learn.microsoft.com/en-us/dotnet/core/additional-tools/dotnet-svcutil-guide?tabs=dotnetsvcutil2x

    Note: I switched all my wcf to rest api and have never used the new tool. You will probable need to generate new proxies.

    If you need to port a wcf service, instead of client, then Microsoft has no solution. There is an open source project (do not know how complete)

    https://github.com/CoreWCF/CoreWCF  
    
    0 comments No comments

Your answer

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