WCF clients under. NET core are also open source, this time with. NET Core 2.0, and WCF for. NET Core 2.0.0, this article describes how to consume a WCF service via proxy under. NET Core.
We can now directly downgrade the WCF service in standard 2.0, but Microsoft WCF Web service Reference Provider is currently in beta, and to use this plugin, you need to install a Visual Studio plug-in, : Https://marketplace.visualstudio.com/items?itemName=WCFCORETEAM. Visualstudiowcfconnectedservice, the use of a lot of inconvenience, blog Park has a blog about this problem http://www.cnblogs.com/qulianqing/p/7197302.html.
A better way to use WCF is to use the proxy pattern encapsulation to invoke the WCF service and isolate the invocation of the WCF service into a separate project, which suggests a github example https://github.com/geffzhang/ Netcore-wcf-service-proxy.
The project includes:
Run the sample project in the following way:
- Download. NET Core 2.0 Sdk&runtime
- To open a solution using Visual Studio Update 3
- Building a solution
- Open the Netcorewebapp project to open the context menu for reference and recovery packages
- Running the solution (Ctrl + f5/f5), you see the following results in the browser:
Using WCF through proxy mode under. Net Core