question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please provide comprehensible information about WCF in .NET Core

See original GitHub issue

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:

Intro

  • Searching for “wcf in .net core” on google shows the “What replaces WCF in .Net Core?” question as first result which has an accepted answer starting with “WCF is not supported in .NET Core”. Based on this, a developer could suppose that there is no WCF in .NET Core. Fortunately, this is not entirely true.
  • Link to this repository (dotnet/wcf) is rather easy to find and the description says that here are “client-oriented WCF libraries” (which I did not understand first; “what is client-oriented?”). Alright, so it seems that I can consume WCF services in .NET Core. Let us find out how.
  • I could not find any developer guide for .NET Core in WCF. For the .NET framework version, there are a lot of material (though they do not really clearly state that applies only for .NET Framework), but for .NET Core, none on docs.microsoft.com as I saw.

Configuration opportunities

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

  • I have found the generated 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).
  • With lack of official documentation about this area, I had to google and I have found the article “Using WCF With .NET Core” by Jon Seeley; and there he states there is no built-in file configuration opportunities for WCF in .NET Core and he constructed a solution for it. But he abandoned it when he saw that the .NET Core version is a lot worse in terms of performance (1/3 as fast). So now, two questions arises in my head:
  • How to configure WCF in .NET Core with files? -> sure, for hello world applications, your library works out of the box, but if it is not configurable outside of code, it is not really usable for applications in production or for anything serious in general.
  • Is the performance really that bad? And why? -> I was planning to migrate our WCF client code to .NET Core until I found out that this can be a lot slower than in .NET Framework. Now I am stuck; will we need to migrate it to gRPC when we want to switch to .NET Core? Is a gRPC client even compatible with a WCF service? Or does it need a “gRPC service”?

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.

Closing words

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.

Looking for advice

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!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:14
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
powerumccommented, Feb 3, 2020

@arphox I did test CoreWCF/CoreWCF with ours open source project ‘Crema’. CoreWCF is not good choice.

  1. Performance is so bad!
  2. Implementation is not good. examples, PerSession scenarios, not good WCF Behavior.
  3. Many not supports.
2reactions
StephenBonikowskycommented, Feb 3, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

CoreWCF 1.0 has been Released, WCF for .NET Core and ...
The CoreWCF Project team has released the 1.0 version of CoreWCF, a port of WCF to the .NET Core platform. It provides a...
Read more >
System.ServiceModel not found in .NET Core project
I have a .NET Core xUnit project. I'm trying to call a WCF service from it but get the following exception: System.InvalidOperationException ...
Read more >
.NET Upgrade Assistant Now Migrates WCF Services to ...
The WCF code is migrated to the CoreWCF library, an open-source port of WCF for .NET Core. The WCF migration extension for the...
Read more >
Add WCF Web Service Reference - .NET
An overview of the Microsoft WCF Web Service Reference Provider Tool that adds functionality for .NET Core and ASP.NET Core projects ...
Read more >
C# WCF Client/Server App in Visual Studio 2019 - YouTube
Net Framework | Visual Studio 2019 WCF is built using the . ... Using WCF, you can send data as asynchronous messages from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found