I need Swagger generate API documentation include UI to test operations.
When use ASP.NET in my project, deps XML files are generated, everything is OK, look like this:
But when I use ASP.NET Core in my project, deps XML files are not generated. It just generates my project comments XML file, look like this:
And when I deploy my project to IIS, the project XML not in deploy files list.
Enable "XML documentation file" checkbox for each project you depend on to generate their files on build. It could be done at project's properties Build tab.
To include all XML files on deploy, add this target to the published project's csproj
file:
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<ItemGroup>
<DocFile Include="bin\*\*\*.xml" />
</ItemGroup>
<Copy SourceFiles="@(DocFile)"
DestinationFolder="$(PublishDir)"
SkipUnchangedFiles="false" />
</Target>
This will copy all XML files from bin
folder and nested subfolders (like bin\Release\netcoreapp1.1\
) to publish
dir. Of course you can customize that target.