WCF Connected Service Visual Studio Extension Preview for ASP.NET 5 Projects

Zhenlan Wang - MSFT

Over the years, many Visual Studio developers have enjoyed the productivity that Add Service Reference Dialog Box provided when their projects need to access Windows Communication Foundation (WCF) services. WCF team is excited to introduce you to the support of Add Service Reference functionality for ASP.NET 5 projects via WCF Connected Service extension preview. This tool retrieves metadata from a WCF service in the current solution, locally or on a network and generates a .NET Core compatible source code file for a WCF client proxy that you can use to access the service.

How to install the extension

The WCF Connected Service extension can be installed on Visual Studio 2015 and it has following prerequisite. Please make sure you have prerequisites installed before installing the extension.

The extension is published into the Visual Studio Extensions Gallery and can be downloaded either from the official Visual Studio Extensions Gallery download page or directly from Visual Studio via the “Extensions and Updates” dialog as shown below by simply searching for “WCF Connected Service”.

How to use the extension

The WCF Connected Service extension is applicable to any projects created with project templates under Visual C# -> Web. This includes Console Application (Package), Class Library (Package) and all ASP.NET 5 templates. I will use an ASP.NET 5 Web Application as an example and walk you through to add a reference to a WCF service to the project.

  1. In Solution Explorer, right-click the References of the project and then click Add Connected Service as shown below. The Add Connected Service dialog box appears.

  2. In Add Connected Service dialog box, click Microsoft on the left column, then click WCF Service – Preview in the middle column and finally click Configure button. This will bring up Configure WCF Service Reference dialog box.

  3. You can either click the Discover button to initiate a search for services that are contained in the current solution or enter the URL for a service in the Address box and then click Go to search for the service hosted at the address.

    The services that are found will be displayed in the Services box and you can select the one you want to use. You can also enter the namespace that you want to use for the reference in the Namespace box. Optionally, you can click through the Next button to make further configuration of DataType Options and Client Options.

  4. Click Finish when you done.

This will download metadata from the WCF service, generate a reference.cs file for the WCF client proxy, and add it to the project under Service References folder. The project.json file of the project will also be updated with WCF NuGet packages for your application to run on .NET Core or framework references for your application to run on full .NET Framework as appropriate. With this, you can create client proxy as you normally do and happy coding!

What’s next and feedback request

This is a preview of the tool. Some of the advanced features such as Reuse types in Referenced Assemblies, are still not supported in this release. We are working to bring in more features. In the meanwhile, we would love to hear your experience of using this tool, any feedback or issues you may see.

1 comment

Discussion is closed. Login to edit/delete existing comments.

  • 程 国静 0

    we can’t find the link to download “WCF Connected service” and can’t find it in vs 2019 extensiond and Updates.

Feedback usabilla icon