Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "Add Service Reference" in .NET Standard project

I would like to do "Add Service Reference" in .NET Standard project.(Visual Studio 2017)

I installed "System.ServiceModel.Http" and "System.ServiceModel.Security" on NuGet in order to make WCF access possible.

However, there is no "Add Service Reference" menu item in the .NET Standard project. How do I add a service reference?

It exists in the .NET Framework project but it does not exist in the .NET Standard project, so it is in trouble.

like image 478
Peri Avatar asked Nov 21 '17 12:11

Peri


People also ask

How do you call a service reference in C#?

In the Project Type pane, select a Visual C# application. In the Templates pane, select a Windows Forms Application. Enter a project name such as CallingServiceExample, and browse to a storage location. In the Solution Explorer, right-click the project name and click Add Service Reference.

How do I add a reference to a web service?

To add a Web Reference You can also open the Add Web Reference dialog box in the Solution Explorer pane by right-clicking References and selecting Add Web Reference. In the Web reference name box, rename the Web reference toExcelWebService. Click Add Reference to add a Web reference for the target Web service.


2 Answers

Visual Studio 2017 Community v15.9.7

Solution Explorer -> Right click Dependencies -> Add Connected Service

ScreenShot:

like image 162
eic Avatar answered Oct 18 '22 21:10

eic


I landed here hoping to solve a slightly different problem... but to maybe answer your question;

I had to update VS2017 to the latest version (I'm now on 15.5.2), then; Right-Click the project >> Add >> Connected Service, then click "Microsoft WCF Web Service Reference Provider". The provided dialog is very similar to that of the Framework "Add Service Reference" option.

It's the same "Add" menu you would use if you were to add a new class etc...

This was added in verion 15.5. See WCF on github for more info.

like image 36
Damo Avatar answered Oct 18 '22 20:10

Damo