© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
13 replies
Gipper

ASP.NET Problem with emailSender in Register Page

Hi, so I did something and now when I go to my Register page (that I got when I create the project with the "Individual Accounts" authentication option), I get this exception:
 InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UI.Services.IEmailSender' while attempting to activate 'Proj_Name.Areas.Identity.Pages.Account.RegisterModel'.
 InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UI.Services.IEmailSender' while attempting to activate 'Proj_Name.Areas.Identity.Pages.Account.RegisterModel'.

I've tried to try to comment ou any reference to emailSender in the entire solution, doing .AddDefaultUI() in my services config, here is that config code btw:
builder.Services.AddIdentity<IdentityUser, IdentityRole>
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddRoles<IdentityRole>()
.AddDefaultTokenProviders()
.AddDefaultUI();
builder.Services.AddIdentity<IdentityUser, IdentityRole>
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddRoles<IdentityRole>()
.AddDefaultTokenProviders()
.AddDefaultUI();

I should say that I don't have an actual emailSender implement nor desire or resources to implement it. I don't actually need to have email confirmation of accounts, I was happy with what it did before which was just show the text page pretending there was an email confirmation feature when there wasn't.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Login & Register in asp.net
C#CC# / help
4mo ago
✅ ASP.NET page help
C#CC# / help
8mo ago
❔ ASP.NET routing problem
C#CC# / help
3y ago
ASP.NET Page with child and parent
C#CC# / help
3y ago