Svcutil --update错误输出没有意义

问题描述

我正在尝试使用svcutil更新肥皂服务引用。

我尝试过:

 dotnet svcutil -u --projectFile "C:\projects\MySolution\MyProject\MyProject.csproj"

其中给出了荒谬的错误

Warning: The specified --projectFile option is not expected in the current operational context of the tool!
Error: The --update option requires a project to be specified,please use the --projectFile option to specify the project to use.

并且:

dotnet svcutil -u --projectFile "C:\projects\MySolution\MyProject\MyServiceFolder"

相同错误

我已经尝试过:

dotnet svcutil -u --projectFile "C:\projects\MySolution\MyProject\MyServiceFolder\dotnet-svcutil.params.json"

相同的错误

我什至尝试过:

dotnet svcutil -u "C:\projects\MySolution\MyProject\Nexus.Services.csproj"

dotnet svcutil -u "C:\projects\MySolution\MyProject\MyServiceFolder"

但这会导致错误

Error: The --update option requires a project to be specified,please use the --projectFile option to specify the project to use.

我找不到任何应如何运行此命令的示例。

有人能用这个吗?

解决方法

您可能需要同时指定项目名称和服务名称。来自帮助dotnet-svcutil --help

--projectFile <project file>要添加客户端的项目文件(如果有)。 (简短格式:-pf)。
--update <web service reference>更新现有的Web服务引用。如果项目包含多个Web服务引用,则需要更新的Web服务引用的名称。 (简短格式:-u)。