Forum Discussion
r00terAF23
Mar 28, 2024Copper Contributor
No Registered Service for IEmailSender
Hello all, I am using ASP.Net Core Web API (.Net Core 😎 to create a web app and API, when i added default Identity and Areas Pages i am getting an error for IEmailSender Service not beeing register...
softmixt
Mar 31, 2024Copper Contributor
I'm using net core 8.0, and for this issue I had to install Microsoft.AspNetCore.Identity.UI package and add .AddDefaultUI();
to my builder.Services.AddIdentity<AppUser, IdentityRole>
// Identity
builder.Services.AddIdentity<AppUser, IdentityRole>(options =>
{
options.User.RequireUniqueEmail = true;
options.Password.RequireDigit = true;
options.Password.RequireLowercase = true;
options.Password.RequireUppercase = true;
options.Password.RequireNonAlphanumeric = true;
options.Password.RequiredLength = 12;
options.SignIn.RequireConfirmedEmail = false;
})
.AddEntityFrameworkStores<ApplicationDBContext>()
.AddDefaultUI();
also I have app.MapIdentityApi<AppUser>(); to map all auth enpoints.
and this fixed my issue.