Swashbuckle CLI 找不到 XML 文件
Swashbuckle CLI cannot find XML file
我正在测试包 Swashbuckle.AspNetCore.Cli 并在 运行 时遇到错误
dotnet swagger "tofile" --output "swagger.json" ".\bin\Debug\netcoreapp2.1\SwaggerTest.Api.dll" v1
Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'C:\Users\Rogier\.nuget\packages\swashbuckle.aspnetcore.cli.0.0-rc2\lib\netcoreapp2.0\SwaggerTest.Api.xml'.
当我将生成的 xml 从项目文件夹移动到 'C:\Users\Rogier\.nuget\packages\swashbuckle.aspnetcore.cli.0.0-rc2\lib\netcoreapp2.0\SwaggerTest.Api.xml'
时,它工作正常并且创建 swagger.json 没有任何错误,但是当我删除文件时, xml 丢失。 XML 没有正确复制,这是 cli 工具中的错误吗?
我正在使用:
"Swashbuckle.AspNetCore.Cli" Version="5.0.0-rc2"
"Swashbuckle.AspNetCore" Version="5.0.0-rc4"
"Swashbuckle.AspNetCore.Annotations" Version="5.0.0-rc4"
netcoreapp2.1
First, in the project properties, check the box labeled "Generate XML Documentation".
You will probably also want to suppress warning 1591, which will now give warnings about any method, class, or field that doesn't have triple-slash comments.
问题已解决。 dotnet swagger "tofile" --output "swagger.json" ".\bin\Debug\netcoreapp2.1\SwaggerTest.Api.dll" v1
必须更改为 dotnet swagger "tofile" --output "swagger.json" "..\SwaggerTest\bin\Debug\netcoreapp2.1\SwaggerTest.Api.dll" v1
。此更改后 swagger.json 文件已正确创建。
将以下行添加到 .csproj 文件:
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
我正在测试包 Swashbuckle.AspNetCore.Cli 并在 运行 时遇到错误
dotnet swagger "tofile" --output "swagger.json" ".\bin\Debug\netcoreapp2.1\SwaggerTest.Api.dll" v1
Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'C:\Users\Rogier\.nuget\packages\swashbuckle.aspnetcore.cli.0.0-rc2\lib\netcoreapp2.0\SwaggerTest.Api.xml'.
当我将生成的 xml 从项目文件夹移动到 'C:\Users\Rogier\.nuget\packages\swashbuckle.aspnetcore.cli.0.0-rc2\lib\netcoreapp2.0\SwaggerTest.Api.xml'
时,它工作正常并且创建 swagger.json 没有任何错误,但是当我删除文件时, xml 丢失。 XML 没有正确复制,这是 cli 工具中的错误吗?
我正在使用:
"Swashbuckle.AspNetCore.Cli" Version="5.0.0-rc2"
"Swashbuckle.AspNetCore" Version="5.0.0-rc4"
"Swashbuckle.AspNetCore.Annotations" Version="5.0.0-rc4"
netcoreapp2.1
First, in the project properties, check the box labeled "Generate XML Documentation".
You will probably also want to suppress warning 1591, which will now give warnings about any method, class, or field that doesn't have triple-slash comments.
问题已解决。 dotnet swagger "tofile" --output "swagger.json" ".\bin\Debug\netcoreapp2.1\SwaggerTest.Api.dll" v1
必须更改为 dotnet swagger "tofile" --output "swagger.json" "..\SwaggerTest\bin\Debug\netcoreapp2.1\SwaggerTest.Api.dll" v1
。此更改后 swagger.json 文件已正确创建。
将以下行添加到 .csproj 文件:
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>