Where can I find namespace "Microsoft.AspNetCore.Identity.UI.Services"

Coreysan 1,816 Reputation points
2022-11-07T17:26:59.487+00:00

I found a tutorial for learning Identity from scratch, with Core 3.1.

It shows how to implement "IEmailSender" if I download NuGet package "Microsoft.AspNetCore.Identity.UI" version 3.1.18.

So it works, and I'll continue my learning, but newer versions of Identity.UI don't include UI.Services. Does this mean I"m learning
something that is deprecated?

Developer technologies | ASP.NET | ASP.NET Core
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-11-08T02:54:07.61+00:00

    Hi @Coreysan ,

    From the IEmailSender Interface and the Microsoft.AspNetCore.Identity.UI source code, we can see the Microsoft.AspNetCore.Identity.UI package contain the Microsoft.AspNetCore.Identity.UI.Services and the IEmailSender.

    258028-image.png

    You can try to add the identity page via the Scaffold Identity. It will auto generate the identity pages and install the required packages, and then you can use the IEmailSender.

    Note, by default, when using Scaffold, it will install the Microsoft.AspNetCore.Identity.UI 3.1.30 version, you can try to use this version.

    Refer to the following steps to create an Asp.net core Application and use Scaffold Identity:

    1. Create an Asp.net core MVC application, select the "Individual Accounts" authentication type.
    2. From Solution Explorer, right-click on the project > Add > New Scaffolded Item.
    3. From the left pane of the Add New Scaffolded Item dialog, select Identity. Select Identity in the center pane. Select the Add button.
    4. In the Add Identity dialog, select the Identity Pages/DbContext you want.
    5. Select Add.

    Then, in the Identity Area, you can find the identity pages, you can see that in the Register.cs file, it will use the IEmailSender interface.

    258072-image.png


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Dillion


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.