Add NuGet package XML documentation to Swagger

Copy XML documentation from NuGet package to project build folder! At my current client, we are building an API that is put together by re-usable “API parts”, eg. ASP.NET Core Application Parts, which works wonders by the way. We can have multiple parts of the API split into small NuGet packages that can be re-used in other systems, that way we only have to implement system specific code, the rest is reused, including documentation etc. Talking about documentation, brings us directly to the issue. We use SwashBuckle to generate our Swagger definition and Swagger UI, and Swashbuckle requires XML documentation, to be able to include documentation from our Controllers and models. I thought we could probably just add a checkbox “Add XML documentation from NuGet package, on build”, but… Unfortunately not. After a lot of research, and looking at NuGets github issues stating this problem I came up with a solution that works both at build time and at publish time (which apparently is handled differently). The Setup We have the following projects: RestAPI (Root website, that will contain multiple API packages) ASP.NET Core website Contains Swagger page System specific API Service implementations BasicAPI (NuGet package) ASP.NET Core website Contains API endpoints, Models, Service interfaces etc. Public XML documentation for its own API and Models .. more NuGet packages to come Include XML documentation, when building NuGet package with .csproj file Our application is very simple, so we have chosen to pack nuget packages with our .csproj file instead of the more explicit .nuspec file. Including...