I have created a new simple solution for test with two base projects. One of this is .NET Core 2.1 another one is .Net Core (.Net Framework).
I have added same nuget packages of NSwag to projects but when run the project based on .Net Framework swagger UI does not work.
.NET Core 2.1 project work perfectly
I add sample solution.
WebCore.zip
Solved by manually installing of Microsoft.AspNetCore.StaticFiles
It was in the docs but i improved it a little bit, https://github.com/RSuter/NSwag/wiki/Middlewares#1-install-required-nuget-packages
(the problem is that this package is not required in every scenario, this is why it's not a dependency of the package)
Most helpful comment
Solved by manually installing of Microsoft.AspNetCore.StaticFiles