I want to add swagger on a new web application created with .Net Core 3.1. I receive an error on the following line:
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
});
'IApplicationBuilder' does not contain a definition for 'UseSwaggerUI' and no accessible extension method 'UseSwaggerUI' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)
even though I have installed Swagger as in the MSDN example.
This is the content of swagger package that came from NuGet:
I have the following usings:
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
What am I missing?
