Adding Identity Scaffolding to .NET MVC Solution – Error running selected code generator

Error: DBContext type 'MvcMovieContext' is found but it does not inherit from Microsoft.ASPNetCore.Identity.EntityFrameworkCore.IdentityDBContext

The process I have followed using latest upgrade of Visual Studio 2019: latest relevant & other packages installed (showing Nuget Solution)

  • Microsoft.AspNetCore.Identity.EntityFrameworkCore 5.0.6
  • Microsoft.EntityFrameworkCore.SqlServer 5.0.6
  • Microsoft.AspNetCore.Identity.UI 5.0.6
  • Microsoft.EntityFrameworkCore.Design 5.0.6
  • Microsoft.EntityFrameworkCore.Tools 5.0.6


using Microsoft.EntityFrameworkCore;
using MvcMovie.Data;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;

public void ConfigureServices(IServiceCollection services)

            services.AddDbContext<MvcMovieContext>(options =>

After specifying Identity scaffolding template

  • keep ~Views\Shared_Layout.cshtml page

  • database context class specified as MvcMovie.Data.MvcMovieContext

  • no files overwritten

  • no user class specified

  • ok

  • process updates dependencies

  • builds solution until error

I have reviewed similar issues here and github. The closest I (newbie) could find was UseSqlServer() method is missing from Microsoft.EntityFrameworkCore.SqlServer

I have looked through the build files of the working MvcMovie solution. I have updated dependencies. If someone could tell me how to troubleshoot why a DBContext type "does not inherit from Microsoft.ASPNetCore.Identity.EntityFrameworkCore.IdentityDBContext" then I would be much obliged.

Read more here:

Content Attribution

This content was originally published by Dave at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: