I just found that I needed to add the following NuGet package in order to get this to work:
Microsoft.AspNetCore.StaticFiles
I was using a vanilla configuration in my code where I setup swagger endpoint:
And where I setup Swagger UI…
Before I installed this package I was getting an HTTP error 500 from http://localhost:8308/swagger and an HTTP error 404 from http://localhost:8308/swagger/ui. However, http://localhost:8308/swagger/v1/swagger.json worked as expected.
Just a little gotchya with Swagger UI + ASP.NET Core!
Share this: