services.AddDatabaseDeveloperPageExceptionFilter(); error code: CS1061

Viewed 10834

i'm coding like below

   public void ConfigureServices(IServiceCollection services)
    {
        services.AddDbContext<SchoolContext>(options => 
             options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
        services.AddDatabaseDeveloperPageExceptionFilter();
        services.AddControllersWithViews();
    }

but i got a error message

Error CS1061 'IServiceCollection' does not contain a definition for 'AddDatabaseDeveloperPageExceptionFilter' and no accessible extension method 'AddDatabaseDeveloperPageExceptionFilter' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)
AspCore_DB C:\Startup.cs 30 Active

this code is officially introduced in the MS guide and i just followed. i'm working on MS Visual studio 2019 v16.8.2

1 Answers
Related