title: ASP.NET Core 2.1 - IdentityUser Issue - Cannot create a DbSet for 'IdentityUser' this type is not included in the model for the context
body: <p>I have upgraded my code from ASP.NET Core 2.0 to Core 2.1. I created a new Core 2.1 project and moved my code into the new project. I have provided samples of my startup and <code>ApplicationDbContext</code></p>
  
  <p>I get the following error when trying to Log In</p>
  
  <blockquote>
    <p>Cannot create a DbSet for 'IdentityUser' because this type is not
    included in the model for the context.
    Microsoft.EntityFrameworkCore.Internal.InternalDbSet.get_EntityType()</p>
  </blockquote>
  
  <p>startup.cs</p>
  
  <pre><code>//Core 2.1
    services.AddDefaultIdentity&lt;IdentityUser&gt;()
              .AddEntityFrameworkStores&lt;ApplicationDbContext&gt;()
              .AddDefaultTokenProviders();            
  
  ////Old Core 2.0 Code
    //services.AddIdentity&lt;ApplicationUser, IdentityRole&gt;()
          //    .AddEntityFrameworkStores&lt;ApplicationDbContext&gt;()
          //    .AddDefaultTokenProviders();
  </code></pre>
  
  <p>ApplicationDbContext.cs</p>
  
  <pre><code>public partial class ApplicationDbContext : 
      IdentityDbContext&lt;ApplicationUser&gt;
  {
      public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; 
   options)
          : base(options)
      {
          Database.EnsureCreated();
       }
   }
  </code></pre>
  
  <p>I have reviewed the following Microsoft articles :
  <a href="https://blogs.msdn.microsoft.com/webdev/2018/05/30/asp-net-core-2-1-0-now-available/" rel="noreferrer">https://blogs.msdn.microsoft.com/webdev/2018/05/30/asp-net-core-2-1-0-now-available/</a></p>
  
  <p><a href="https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1" rel="noreferrer">https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1</a></p>