0
namespace MobileHealthScreeningPortal
{
    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc(options => options.EnableEndpointRouting = false);
            services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
                    .AddCookie(options => {
                        options.LoginPath = "/Account/Login/";
                        options.AccessDeniedPath = "/Account/Forbidden/";
                    });
            services.AddIdentity<SysUser, IdentityRole<int>>()
            {
                options.SignIn.RequireConfirmedEmail = true;
            })
    .AddEntityFrameworkStores<ApplicationDbContext>()
    .AddDefaultTokenProviders();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
       
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            app.UseApplicationInsightsRequestTelemetry();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            app.UseStaticFiles();
            app.UseAuthentication();
            app.UseMvcWithDefaultRoute();
            app.UseApplicationInsightsExceptionTelemetry();
            app.UseIdentity();

        }
    }
}

while trying to call AddDefaultTokenProviders() method that generates tokens for email confirmation for my register function, I encountered errors like The name 'AddEntityFrameworkStores' does not exist in the current context', 'ILoggerFactory' does not contain a definition for 'AddDebug' and the best extension method overload 'DebugLoggerFactoryExtensions.AddDebug(ILoggingBuilder)' requires a receiver of type 'ILoggingBuilder'.

I am not sure what the errors are referring to or talking about. I am very new to C# and I am trying do well for school so any help will be greatly appreciated!! Thank you

kiafiore
  • 1,071
  • 2
  • 11
  • 27

0 Answers0