23

I have two Web Project.

First of them is created about 2-3 weeks ago. Second of them is created today.

I want to add Web Reference to the second web project.

First old Project Solution View

First old Project Solution View

Second new Project Solution View

enter image description here

In new Project I can't find how to add Web Reference. I can add Service Reference but I don't need it.

From here I can add Service Reference

enter image description here

but I can't add Web Reference Like it was in old project

enter image description here

From where I should add Web Reference? Is there any changes regarding web references?

16
  • please check this link: marketplace.visualstudio.com/… Commented Aug 11, 2017 at 12:51
  • I already installed it, So i can add Service Reference. Commented Aug 11, 2017 at 13:05
  • Yes, you can add classic web service to your .core project. Commented Aug 11, 2017 at 13:16
  • I am getting this error The service at the following URI does not have any endpoints compatible with .Net Core apps:'C:\Users\Luka\Desktop\Service.wsdl' I was getting this also, in old project, while adding as Service Reference. but i added as Web Reference without this problem. Commented Aug 11, 2017 at 13:34
  • 1
    @LukinoGrdzelishvili would you try Web Services Description Language Tool (Wsdl.exe) to generate C# code using command line? Commented Feb 12, 2019 at 15:07

2 Answers 2

0
  • Select old project in Solution Explorer.
  • Click 'Show All Files' button Solution Explorer toolbar.
  • Service node will be expanded and you will see the nested nodes with generated code.
  • You should find the link to WSDL file, which describes your web service.
  • To load a service metadata from a WSDL file, select Browse in Add Web Reference dialog.

Documentation states:

The WCF Web Service Reference tool retrieves metadata from a web service in the current solution, on a network location, or from a WSDL file, and generates a source file containing Windows Communication Foundation (WCF) client proxy code that your .NET app can use to access the web service.

Sign up to request clarification or add additional context in comments.

4 Comments

This does not add it in a compatible way.
What do you mean @MotKohn ?
the generated reference.cs even when doing it your prescribed way with loading the file from old project is not usable and does not match at all what the add reference looked like when using .net>Add References>Advanced>Add Web Reference. See github.com/dotnet/wcf/issues/3750
@MotKohn that's simply wrong and the link you point to has nothing to do with non WCF services. Anyone who had to migrate code using non-WS-* compliant services like those used by airlines and banks from .NET Framework to .NET Core actually copied the old source. WCF is pretty strict about SOAP compliance and many of the big companies (like Sabre) created their services using Oracle's proposals that never became standard. ASMX/Add Web References is more lenient
-1

Here's what I would try in a command line:

  • cd "Full path to folder where ConsoleApp1 project lives"
  • dotnet add package "Full path to Test projects .csproj file"

This command should edit your ConsoleApp1.csproj file. Then you can try to build it with:

  • dotnet build

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.