12
votes

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

2
install dotnet-svcutil by writing this command ===> Install-Package dotnet-svcutilburg.developer
@burg.developer "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"Bhav
do you find any solution for this ?Jay
@Jay No, I haven't.Bhav
do you have any alternative solution ? if any than please share.Jay

2 Answers

3
votes

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

0
votes

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.