Hi I've created a new ASP.NET Core 2.0 MVC Web App (.NET Framework 4.6.1) with Individual User Accounts. I'm quite confused regarding what version of Identity is being used by this template. I assume its must me "ASP.NET Identity 2.0", but if I have understood it correctly there's also something called "ASP.NET Core 2.0 Identity 2.0". So which one is being used by the template?
2 Answers
UPDATED ANSWER:
Well - Microsoft.AspNetCore.Identity is the core package or foundation of the AUthentication in AspNetCore. It just provides the contracts for Authentication stuff. You still need a mechanism to store the Authentication related data.
Microsoft.AspNetCore.Identity.EntityFrameworkCore - provies the storage related things for your Authentication using EntityFrameworkCore as the data layer. Basically it provides you Code First implementation of data storage.
When you look at the package definition of Microsoft.AspNetCore.Identity.EntityFrameworkCore on Nuget here: https://www.nuget.org/packages/Microsoft.AspNetCore.Identity.EntityFrameworkCore/ - pay close attention to dependenies. Microsoft.AspNetCore.Identity as one of the core dependency.
Go to Solution Explorer of your project in Visual Studio. Expand the Dependencies node and you will see that Microsoft.AspNetCore.Identity is indeed referenced. Here is the screen shot from my VS:
hope this helps
With ASP.NET Core - everything you use as additional package has to be core based. With respect to Authentication - its commonly known as ASP.NET Core Identity. The package used is known as "Microsoft.AspNetCore.Identity" currently this package is at version 2.0.1. This is the version which you will use for ASP.NET Core 2.0 projects.
i have Visual Studio 2017 (15.4.4). I just created a ASP.NET Core 2.0 application with .NET Framework 4.6.1 as the hosting platform. i created the web app with "individual user accounts" auth type.
If you open the .csproj - you can look at the PackageReferene nodes. It uses the following packages:
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.1" />
Also, you can learn all about Identity here - https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity?tabs=visual-studio%2Caspnetcore2x
Hope this helps.
Look in your .csproj file. Do you have a package reference named
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
If so, you are using Microsoft.AspNetCore.Identity 2.0.0. This reference package contains all off the This package consists of every single package shipped by Microsoft as part of ASP.NET Core 2.0, including all the Razor packages, MVC packages, Entity Framework Core packages, and more. You do not have to reference individual packages when using this package, but you can see them in the dependencies.
