23

I am implementing the AspNet identity in ASP.NET MVC application. But when I am going through the online materials I am quite confused about the 2 dlls Microsoft.Aspnet.Identity.Core and Microsoft.AspNetCore.Identity.

I do know that Microsoft.AspNetCore.Identity is to be used in .NET Core applications but Microsoft.Aspnet.Identity.Core seems to have no recent updates and found that it is not even letting the user to login (throwing Failure in custom asp identity). So my question is can I use Microsoft.AspNetCore.Identity in MVC application or should I stick to Microsoft.Aspnet.Identity.Core?

Lucas
  • 17,277
  • 5
  • 45
  • 40
Joe 89
  • 850
  • 1
  • 12
  • 30
  • There is also 'A compatibility layer for sharing identity databases between Microsoft.AspNet.Identity.EntityFramework and Microsoft.AspNetCore.Identity.EntityFrameworkCore.' which is https://www.nuget.org/packages/Microsoft.AspNet.Identity.AspNetCoreCompat/ – Simon_Weaver Mar 25 '21 at 01:33

1 Answers1

35

Microsoft.AspNet.Identity.Core has nothing to do with ASP.NET Core, it's just a way to tell that it is the main (hence the word "core") library of ASP.NET Identity (pre-ASP.NET Core version). Since you are not using ASP.NET Core, you have to use Microsoft.AspNet.Identity.Core.

Basically, you have two scenarios:

  • Either you're using ASP.NET Core, in which case you'll have to use Microsoft.AspNetCore.Identity
  • Or you're using an ASP.NET version before ASP.NET Core, and you'll have to use Microsoft.AspNet.Identity.Core.
Pierre-Loup Pagniez
  • 3,611
  • 3
  • 29
  • 29
  • 21
    Thanks for the clarification. Quite ridiculous naming going on there. – Craig Jan 24 '18 at 10:57
  • i still dont get it so, they stopped updating Microsoft.AspNet.Identity.Core and Microsoft.AspNetCore.Identity is .net core only but they should be decoupled from platform. grrr so confused. I want to use the latest but cant as they only updated Microsoft.AspNetCore.Identity with the new stuff? but should be complete independent of EF or DB, and therefore it the latest Identity should be able to work in Either? – Seabizkit Jul 28 '21 at 21:47
  • You can't use Microsoft.AspNetCore.Identity with ASP.NET non-Core. If you're not using ASP.NET Core, you have to use Microsoft.AspNet.Identity.Core. – Pierre-Loup Pagniez Aug 09 '21 at 09:58