|
在使用 asp.net core 引用 WCF 服务的时候,报错如下:
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.300\Sdks\Microsoft.NET.Sdk\targets\GenerateDeps\GenerateDeps.proj
Done.
尝试执行如下命令:
报错如下:
Telemetry is: Enabled
projectfactory: MSBUILD_EXE_PATH = C:\Program Files\dotnet\sdk\3.1.300\MSBuild.dll
projectfactory: MSBuild project path =
projecttoolscommandresolver: ProjectFactory did not find Project.
Microsoft.DotNet.Cli.Utils.CommandUnknownException: Could not execute because the specified command or file was not found.
Possible reasons for this include: * You misspelled a built-in dotnet command.
* You intended to execute a .NET Core program, but dotnet-svcutil does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
at Microsoft.DotNet.CommandFactory.CommandFactoryUsingResolver.Create(ICommandResolverPolicy commandResolverPolicy, String commandName, IEnumerable`1 args, NuGetFramework framework, String configuration, String outputPath, String applicationName) at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient) at Microsoft.DotNet.Cli.Program.Main(String[] args)
解决方案
使用 dotnet-cli 命令全局安装 svcutil 工具,命令如下:
重新引用WCF Service即可。
https://github.com/dotnet/wcf/bl ... -Reference-notes.md
|
上一篇:Nuget 设置 HTTP 代理访问下一篇:CentOS 系统硬件要求的配置
|