After deploying our ASP.NET Core application using Web Deploy, we noticed a problem with our Swagger integration through SwashBuckle. Normally SwashBuckle can integrate documentation in your Swagger UI by extracting and reading the XML comments added to your code.
Problem was that when this XML isn’t copied Swashbuckle throws an exception making our whole API unavailable. Some research showed that the problem appeared after migrating from the project.json format back to csproj, after which the <DocumentationFile>
was no longer automatically copied to the output folder during the build or publish process.
The solution I used was to add the following snippet to your csproj: