Search code examples
c#.netwcfwsdl.net-standard

Add "Connected service" in .netStandard2.0 project


I would like to add a "connected service" in my .Net Standard 2.0 project (class library) (Visual Studio 2019)

I have a .wsdl file. And I tried to add a "connected service" to my project but an error occured : enter image description here

When I test to import the same .wsdl file in a .netFramework4.5.2 project there is no error and the service is added.

Do you have any idea about the problem ?


Solution

  • You need to install Nuget

    https://www.nuget.org/packages/dotnet-svcutil

    then

    dotnet restore

    dotnet-svcutil is a command-line tool for generating a web service reference compatible with .NET Core and .NET Standard projects.

    The dotnet-svcutil tool is an alternative option to the WCF Web Service Reference Visual Studio connected service provider that first shipped with Visual Studio 2017 version 15.5. The dotnet-svcutil tool as a .NET Core CLI tool, is available cross-platform on Linux, macOS, and Windows.

    Please check below links for more help

    https://learn.microsoft.com/en-us/dotnet/core/additional-tools/dotnet-svcutil-guide?tabs=dotnetsvcutil2x

    https://stackoverflow.com/a/53808893/5829426