AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Unclear documentation

Open Kool-Koder opened this issue 7 years ago • 2 comments

After the following code has been done as instructed by the tutorial, the application fails to run.

public class IdentityHostingStartup : IHostingStartup
{
    public void Configure(IWebHostBuilder builder)
    {
        builder.ConfigureServices((context, services) => {
            services.AddDbContext<WebPWrecoverContext>(options =>
                options.UseSqlServer(
                    context.Configuration.GetConnectionString("WebPWrecoverContextConnection")));

            services.AddDefaultIdentity<IdentityUser>(config =>
                {
                    config.SignIn.RequireConfirmedEmail = true;
                })
                .AddEntityFrameworkStores<WebPWrecoverContext>();
        });
    }
}

After about an hour of research, discovered that the same the startup.cs file. Please edit the docs to inform users to comment out this line of code.

//services.AddIdentity<IdentityUser, IdentityRole>()
//    .AddEntityFrameworkStores<ApplicationDbContext>()
//    .AddDefaultTokenProviders();   

Kool-Koder avatar Dec 24 '18 13:12 Kool-Koder

Hello @Kool-Koder ... It's best to open these from the bottom of the topic using the Content feedback button ... it tags the issue with the topic's metadata that helps our tracking. No worries ... this is for ...

Account confirmation and password recovery in ASP.NET Core https://docs.microsoft.com/aspnet/core/security/authentication/accconfirm @Rick-Anderson

guardrex avatar Dec 24 '18 14:12 guardrex

Hi. I have done so. Thanks for pointing out! :)

Kool-Koder avatar Dec 24 '18 14:12 Kool-Koder