10

I'm attempting to add a WCF service reference to a .Net Core 3.1 web API. I'm using Visual Studio 2019 in admin mode. I get the following error:

Importing web service metadata ...
Number of service endpoints found: 1
Scaffolding service reference code ...
Error:Unable to generate deps.json, it may have been already generated.  You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d <toolname>": C:\Program Files\dotnet\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\GenerateDeps\GenerateDeps.proj

Anyone have any ideas how to resolve this?

I've tried installing dotnet-svcutil but I get the following error:

Package dotnet-svcutil 2.0.1 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package dotnet-svcutil 2.0.1 supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1) / any

abatishchev
  • 92,232
  • 78
  • 284
  • 421
Bhav
  • 1,466
  • 5
  • 24
  • 48

2 Answers2

2

Dotnet released preview of version 2.0.3. which work with dotnet Core 3.1. Install it trough package manager console and reopen project.

dotnet tool install --global dotnet-svcutil --version 2.0.3-preview1.20574.1

In solution explorer right click on project name -> Add -> Connected Service, should offer Microsoft WCF Web Service Reference Provider

marc_s
  • 675,133
  • 158
  • 1,253
  • 1,388
ElectroNis
  • 71
  • 3
0

I faced the same issue.

Open Visual Studio Developer Command prompt and use below command "svcutil *.wsdl" or "svcutil https://somestire.svc"

This will create Class file in that specific folder.