首页 > 解决方案 > 将连接的 Web 服务 WCF 引用添加到 .Net Core API 时出错

问题描述

Importing web service metadata ...
Number of service endpoints found: 2
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\2.1.503\Sdks\Microsoft.NET.Sdk\targets\GenerateDeps\GenerateDeps.proj
Done.

标签: wcfasp.net-core

解决方案


.NET Standard 2.0最近在带有类库的 Visual Studio 2019 (16.8.4) 中遇到了同样的问题。我能够svcutil.exe从命令行使用现有的 Web 服务 (asmx) 生成代码。但是使用 Visual Studio ( Microsoft WCF Web Service Reference Provider) 我得到了这个错误。

对我来说有趣的是,以管理员身份运行 Visual Studio 为我解决了问题(老实说,我没想到会这样)。


推荐阅读