Swagger UI on Service Fabric with Stateless ASP.NET Core WebAPI

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!

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s