当使用以下命令行时,我在使用文章使用 AutoRest 生成 API 客户端中的示例 MS PowerShell 脚本时收到主题错误消息
dotnet swagger "tofile" --output "../../res/swagger.json" "../Sample.Api/bin/Debug/netcoreapp2.1/Sample.Api.dll" v1
被执行。解决方案?
仅供参考:Swashbuckle.AspNetCore.Cli 入口源代码位于此处:Swashbuckle.AspNetCore/src/Swashbuckle.AspNetCore.Cli/Program.cs
更新
我应该发布运行时错误消息的全文 - 这里是:
At C:\Tests\Swashbuckle\build.ps1:8 char:1
+ dotnet swagger "tofile" --output "../../res/swagger.json" "../Sample. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.OpenApi,
Version=1.1.1.0, Culture=neutral, PublicKeyToken=3f5743946376f042'.
The system cannot find the file specified.
at Swashbuckle.AspNetCore.Cli.Program.<>c.<Main>b__0_3(IDictionary`2 namedArgs)
at Swashbuckle.AspNetCore.Cli.CommandRunner.Run(IEnumerable`1 args)
at Swashbuckle.AspNetCore.Cli.CommandRunner.Run(IEnumerable`1 args)
at Swashbuckle.AspNetCore.Cli.Program.Main(String[] args)