Hi!
I am writing this issue to recommend You to provide comprehensible information about WCF in .NET Core.
Please let me justify why I recommend it with some facts:
.NET Framework: you add a service reference to the project, and XML-based configuration will be generated to your app.config file, inside the <system.serviceModel> tag. This is fine and required (if you remove this configuration, your code won't work). For different enviroments (test, prod) you only have to change the XML configuration (e.g. ASP.NET web.config files as transforms).
.NET Core: XML-based configuration does not really exist since in .NET Core, the place for settings (as far as I know) is the appsettings.json file, and had no idea how to configure it in configuration files.
ConnectedService.json which turned out is only used for the client generation tool. (Turned out from a github issue, not a documentation or guide or so which is sad for me).Of course I found code in the generated Reference.cs file for client classes which have several constructors those allow to inject various EndpointConfiguration, endpoint addresses and so on; but is this the only way to configure it (again, I repeat, I miss documentation so much)? If yes, that means we will have to build our own file config management system (sections, elements, etc) and create clients with those settings, but all these require a lot of extra code.
In my opinion, the best place for such documentation and knowledge base would be here, in this repository; I say that it should be at the beginning of the README, because developers are simply lost without information like these. And under documentation I do not only mean the answers for my questions, but a complete guide to what a WCF has been and what it will be in the future, from the client side.
I also would like to ask advice about our production application: currently, we have a .NET Framework application which has like ~12 WCF service reference along with generated client code those are tens of thousands line of code. We only use WCF for consuming. We have a NuGet package which encapsulates and simplify all these communication and our main business applications use this NuGet package to communicate with the service. The services are third party for us, so we cannot change their side.
We configure this NuGet in our ASP.NET applications' Web.config file (and tests' app.config file); all these in .NET Framework. We want to update our NuGet to .NET Standard so our new .NET Core-based "ASP.NET Core" services will also be able to use this NuGet. So both our legacy and new systems will be able to work on the same NuGet.
I think this is (or will be) a relatively common scenario in the future and it would be great if you could give some advice related this question.
Thank you very much in advance!
I forgot to mention it but there is one more general question.
I have found the CoreWCF/CoreWCF repository which also seems to be a .NET Core WCF implementation, and even the .NET foundation wrote an article about this repository.
This (dotnet/wcf) repository seems a lot more authentic for me than the CoreWCF repository, but still the question arises? Who are They, who are You, why do we need two different .NET Core WCF implementation, and why the .NET foundation funds two different projects for this?
@arphox Thanks for taking the time to provide this feedback. I agree our documentation is less than ideal. I do have a task to do some work related to this topic. I'll keep this issue assigned to me so we can incorporate youor feedback into the planned work. Thanks.
@arphox I did test CoreWCF/CoreWCF with ours open source project 'Crema'.
CoreWCF is not good choice.
PerSession scenarios, not good WCF Behavior.@mconnew
@arphox Regarding the CoreWCF repository.
I recently responded on another issue with information that is relevant to your question about what is the dotnet/wcf repository.
https://github.com/dotnet/wcf/issues/4079#issuecomment-580551893
The short version is that Microsoft with this repo is supporting WCF Client side functionality only.
The WCF Server side functionality is going into the CoreWCF repo and while all the initial work to get it to a workable state is being done by a Microsoft employee, it is a "community owned" open source project. It is not yet in a 'production ready' state but work is continuing to get it there.
@powerumc CoreWCF is not yet production ready and is under active development.
arphox described my exact experience over the last day. I'm very thankful this project exists and is even integrated into Visual Studio now, but am missing the configuration. I'm taking a stab at recreating it using the Option pattern (and just noticed the HttpBinding does not have the HostNameComparisonMode property it had in .NET Framework, which led me here.)
Hello @StephenBonikowsky any news on How to configure WCF in .NET Core with files?
We need to set ClientCredentialType to Certificate but can't find how to set it with a config file.
At https://docs.microsoft.com/en-us/dotnet/framework/wcf/how-to-set-the-security-mode they show how to do in .Net Framework:
<wsHttpBinding>
<binding name="TransportSecurity">
<security mode="Transport" >
<transport clientCredentialType = "Certificate" />
</security>
</binding>
</wsHttpBinding >
For now, I'm setting it in GetBinding For Endpoint, but it get override when I update the service

@HongGit and @mconnew can you help with this question?
Hello @StephenBonikowsky any news on How to configure WCF in .NET Core with files?
We need to set
ClientCredentialTypetoCertificatebut can't find how to set it with a config file.At https://docs.microsoft.com/en-us/dotnet/framework/wcf/how-to-set-the-security-mode they show how to do in .Net Framework:
<wsHttpBinding> <binding name="TransportSecurity"> <security mode="Transport" > <transport clientCredentialType = "Certificate" /> </security> </binding> </wsHttpBinding >For now, I'm setting it in
GetBinding For Endpoint, but it get override when I update the service
I found out you can pass the binding as a parameter when you create a new client.
Example:
System.ServiceModel.BasicHttpBinding customBinding = new System.ServiceModel.BasicHttpBinding();
customBinding.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
customBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
ServiceReference.ServiceClient myServiceClient = new ServiceReference.ServiceClient (customBinding ,new EndpointAddress("YourEndPointURLHere"));
Hope this helps.
Most helpful comment
@mconnew
@arphox Regarding the CoreWCF repository.
I recently responded on another issue with information that is relevant to your question about what is the dotnet/wcf repository.
https://github.com/dotnet/wcf/issues/4079#issuecomment-580551893
The short version is that Microsoft with this repo is supporting WCF Client side functionality only.
The WCF Server side functionality is going into the CoreWCF repo and while all the initial work to get it to a workable state is being done by a Microsoft employee, it is a "community owned" open source project. It is not yet in a 'production ready' state but work is continuing to get it there.
@powerumc CoreWCF is not yet production ready and is under active development.