我希望在构建过程中生成Swagger.Json文件,并在API网关中使用它来配置端点。
我尝试了以下步骤,但没有成功。
创建工具清单:
dotnet new tool-manifest
安装Swashbuckle CLI工具并将其添加到本地清单文件中:但是这一步失败了
dotnet tool install --version 6.4.0 Swashbuckle.AspNetCore.Cli
错误:
NU1202: Package Swashbuckle.AspNetCore.Cli 6.4.0 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Swashbuckle.AspNetCore.Cli 6.4.0 supports:
- net5.0 (.NETCoreApp,Version=v5.0) / any
- net6.0 (.NETCoreApp,Version=v6.0) / any
- netcoreapp2.1 (.NETCoreApp,Version=v2.1) / any
- netcoreapp3.0 (.NETCoreApp,Version=v3.0) / any
NU1212: Invalid project-package combination for Swashbuckle.AspNetCore.Cli 6.4.0. DotnetToolReference project style can only contain references of the DotnetTool type
NU1212: Invalid project-package combination for Swashbuckle.AspNetCore.Cli 6.4.0. DotnetToolReference project style can only contain references of the DotnetTool type
Package 'Swashbuckle.AspNetCore.Cli 6.4.0' has a package type 'DotnetTool' that is not supported by project 'WebApi'.