.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)

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,161 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 65,396 Reputation points
    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 Answers by the question author, which helps users to know the answer solved the author's problem.