After creating a new API project in vs2019 with Core 3.1 and installing the Swashbuckle.AspNetCore.Swagger 5.0, adding the using, the moment is there....
Copy past the github Getting started code block....
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" });
});
The AddSwaggerGen is NOT there. However the app.UseSwagger() in the method Configure is there, and proofs Swagger is installed.
Sorry guys, but I like to work with swagger, Hope you can solve it.
You’ve only installed one of the component packages (i.e. Swashbuckle.AspNetCore.Swagger). You need to install the main package “Swashbuckle.AspNetCore” as described in the readme
You are completely right. That is a bold mistake. Thank you for the acuity, I missed that.
Most helpful comment
You’ve only installed one of the component packages (i.e. Swashbuckle.AspNetCore.Swagger). You need to install the main package “Swashbuckle.AspNetCore” as described in the readme