title: Use Microsoft.AspNetCore.Identity in .Net Standard Project?
body: <p>I am about to migrate legacy code (.Net framework) to .Net Standard (2.0, Not 2.1 so that its still compatible to Framework 4.7 and Core 3.0). The old libraries are using <code>System.Web.Security</code> to access the database (User and Membership etc.). I already changed that to the new Identity model with IdentityServer4. </p>
  
  <p><strong>My Question for this Issue:</strong>
  Can I use <code>Microsoft.AspNetCore.Identity</code> in a <code>.Net Standard</code> Project? </p>
  
  <p>I read some discussion on Git and was confused. Apparently there is a difference in <code>.Net standard</code> 2.0 and 2.1, but NUGET allows me to install the "Microsoft.AspNetCore.Identity" for <code>.Net Standard 2.0</code>. </p>
  
  <p>I want to know this, because this would make the migration a bit easier by "just" replacing the old classes with the new classes in <code>Microsoft.AspNetCore.Identity</code>. Otherwise I need to remove everything Identity related in the .Net Standard Libraries. </p>
  
  <p>Unfortunately I cannot use <code>.Net Core 3.0</code> for the Libraries, because the Libs need to be used in a WebForms App (.Net Framework 4.7).</p>
  
  <p><strong>Edit 1:</strong> thank you for the replies. That already helped me. 
  But I have a follow up question:</p>
  
  <p>The thing that confuses me is that I will use those Libs in a WebForms Application and I read some things about the old Frameworks not supporting the new Identity Model of aspnet core. As an example: Can I use the "ApplicationUser"-Class inside a custom .Net standard Library in the Code Behind of a WebForms app (in the case that I wrapped all User-Management in a separate .Net Standard Dll)?</p>
  
  <p><strong>Edit 2:</strong> Here is the discussion that irritated me: <a href="https://github.com/dotnet/aspnetcore/issues/3756#issuecomment-434114175" rel="nofollow noreferrer">https://github.com/dotnet/aspnetcore/issues/3756#issuecomment-434114175</a> regarding the "Microsoft.AspNetCore.Identity" support in .Net Standard (even the namespace "Microsoft.<strong>AspNetCore</strong>.Identity" made me think its not supposed to work on .Net Standard)</p>
  
  <p><strong>Edit 3:</strong>
  So, I tried to use Microsoft.AspNetCore.Identity to use "IdentityUser" in a .Net Standard Library. Turnes out EntityFramework needs to be added in the references as well and I get this error. </p>
  
  <p>Package 'EntityFramework 6.1.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.</p>
  
  <p><strong>How to fix this:</strong> For .Net Standard 2.0 install this Microsoft.Extensions.Identity.Stores.
  And for .Net Standard 2.1 this can be installed Microsoft.AspNetCore.Identity.EntityFrameworkCore</p>