Fork me on GitHub

.NetCore利用Swagger生成 XML文档需要注意生成路径的地址

发布的时候如果用 release

dotnet publish --configuration release  

dotnet publish 默认都是debug

会出现 XML丢失问题,其实可以看下工程文件

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DocumentationFile>bin\Debug\netcoreapp2.0\UserServicesApi.xml</DocumentationFile>
  </PropertyGroup>

注意到是Debug目录

或者看下项目属性的输出

 

修改一下 Release目录

 

 

所以发布 Release的时候要注意这个问题

 

posted @ 2018-07-12 15:17  龙码精神  阅读(4842)  评论(0编辑  收藏  举报