netcore发布时 swagger xml发布丢失问题

1、netcore2.1.2,swagger.aspnetcore 1.1.0版本。发布netcore项目时swagger的接口文档xml 遗漏,始终发布不上去。后来查阅资料,讲的好像是netcore的一个bug,默认过滤掉一些xml文件。如果需要发布,则需要改动csproj文件或project.json文件。

https://stackoverflow.com/questions/42385162/xml-documentation-file-is-not-included-in-publish-folder

2、修改csproj文件(注意不是.csproj.user,下面的节点,都添加进去)

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

posted on 2024-05-21 10:20  侗家小蚁哥  阅读(40)  评论(0编辑  收藏  举报