3

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 ?

Nathan Bruet
  • 328
  • 1
  • 5
  • 17
  • 1
    Due to the fact that DotNet standard project is not well compatible with WCF, dotnet Core as well. therefore the core-based client does not support the WCF service with Ws* binding type, plus message security mode. I would like to know the configuration on the server-side or the automatically generated client-side configuration located in Dotnetframework. So that we can know whether the current project will support invocation to the WCF service. – Abraham Qian Jan 14 '20 at 09:35

1 Answers1

3

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

Ajay
  • 209
  • 2
  • 13
  • I try to install it but it's not compatible : `Package dotnet-svcutil 2.0.1 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package dotnet-svcutil 2.0.1 supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1)` – Nathan Bruet Jan 13 '20 at 16:29
  • Updated the above answer. Now added actual Nuget URL and some more info. – Ajay Jan 13 '20 at 18:00