1.输出xml文件
选中API项目,鼠标右击,选中"属性",
勾选"生成>>输出>>文档文件"
修改Program.cs中配置
//var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSwaggerGen
(
options =>
{
options.SwaggerDoc("v1", new OpenApiInfo()
{
Title = "Title",
Version = "v1",
Description = "Description",
});
var path = Path.Combine(AppContext.BaseDirectory, "TileMapApi.xml");
options.IncludeXmlComments(path, true);
options.OrderActionsBy(_ => _.RelativePath);
}
);
//var app = builder.Build();
app.UseSwagger();
app.UseSwaggerUI();
标签:Core,builder,Title,--,app,--.,var,options
From: https://www.cnblogs.com/love-zf/p/17661019.html