[Fixed] IServiceCollection doesn’t contain definition of AddSwaggerGen

In this post, I will show how did I fix the issue of adding Swagger in the .net core.

I was trying to install the Swagger in my first .net core project. I did it very easily in ASP.Net MVC very easily but getting issues with .net core.

I installed the NuGet package but was getting still an issue. I found it’s due to I installed the wrong package. After installing the correct one I got it working.

swagger in .net core

swgger .net core

I hope it will save your time too.

Thanks!

Posted by | View Post | View Group