Looking at the ConfigureServices method
Let's compare the current ConfigureServices method with a previous Long-Term Support version to see what has changed. If you were to create a new ASP.NET Core project using version 3.1 and open Startup.cs, you would find the method to configure the services, which looks like this:
public void ConfigureServices(IServiceCollection services)
{
    services.Configure<CookiePolicyOptions>(options =>
    {
        // This lambda determines whether user
        // consent for non-essential cookies is
        // needed for a given request.
         options.CheckConsentNeeded = context => true;
    });
    services.AddControllersWithViews();
    services.AddRazorPages();...