netcore釋出時 swagger xml釋出丟失問題

侗家小蚁哥發表於2024-05-21
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>

相關文章