26

I see I can "Add Service Reference", but I'm trying to "Add Web Reference" because I'm following some sample code which does that, and I can't find that option...

1
  • The web references were since replaced by service references. Especially when targeting dotnet core or 5, don't use the old web references. The generated client doesn't do async well, won't fully understand generics and more. Even the service references are considered school now. Web API REST services should be your goto for new externally visible clients, protobuf for higher performing internal apis. Commented Nov 25, 2020 at 18:11

3 Answers 3

31

In that window click "Advanced...", and in the new window click "Add Web Reference...". They hid it, because it is old technology, but still in use.

3
  • 2
    This doesn't seem to match the UI in VS2019. For example, if I "File / New Project", choose "ASP.NET Core Web Application", choose a name and location, and then select .NET Core , ASP.NET Core 3.1 and Web Application, in solution explorer if I right-click the name I entered and select "add", I can select "add reference" or "add service reference", but on neither page is there an "advanced" button. Commented Jan 7, 2020 at 18:49
  • The question is about .NET Framework projects (WinForms, WPF, Console). Or it could be about that. OP never responded. Commented Jan 7, 2020 at 20:31
  • 2
    @SomeoneElse Yeah, this option is not available in .Net Core projects. You can do it if you target .Net Framework instead. Commented Nov 24, 2020 at 17:53
3

Having looked at it a bit more, the current Microsoft story seems to be at https://learn.microsoft.com/en-us/dotnet/core/additional-tools/wcf-web-service-reference-guide . If you follow that you can tell a WCF project about an existing SOAP web service, and it'll set up at least some of the references. It's not complete yet though (see the issues here) and is by no means a drop-in replacement for the previous functionality.

When importing a web service with warnings a web browser will open up on the release notes - some of the other links from there may be useful.

3

A potential workaround, at least for .NET framework users,

Just discovered that (in VS2019 at least) I can only add a WCF service reference to a project targeting .NET 5.0 and not in earlier frameworks. When targeting, say, 4.6.2 (as we are currently restrained by some legacy components) then I see only Azure, SQL and other connected service types. But after switching a test project to 5.0 I finally get this,

VS-2019-ConnectedServiceOptions

Now, it doesn't contain the Advanced/Add Web Reference screen that I'd used in prior years but this WCF wizard worked with an endpoint that previously only worked for that "Web Reference" and I now have my reference.

I was also able to revert the project to .NET 4.6.2 after adding this.

1
  • Nice workflow, Microsoft
    – B H
    Commented Aug 29, 2022 at 22:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.