Why Swashbuckle.aspnet.core.swagger not being recognized

user10489212 picture user10489212 · Nov 30, 2018 · Viewed 9k times · Source

I've installed though nuget package manager the Swashbuckle.AspNetCore.Swagger and had included the using Swashbuckle.AspNetCore.Swagger on the top, but I get error on the Info{ Title} methods. Can anyone please suggest how to solve this issue.

 services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info { Title = "My DAB API", Version = "V3.2.2" });
            }); 

Answer

Jesus Rendon picture Jesus Rendon · Mar 28, 2019

I find Solution.

For version 5

using Microsoft.OpenApi.Models;


services.AddSwaggerGen(c =>
{
    c.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" });
});