I\'ve got an older asp.net core identity database, and I want to map a new project (a web api) to it.
Just for the test, I copied the Models folder, and the Applicat
Do you have the app.UseIdentity();
call in the Configure
method:
public void Configure(IApplicationBuilder app,
IHostingEnvironment env, ILoggerFactory loggerFactory)
{
/*...*/
app.UseIdentity();
/*...*/
}
EDIT
Do you also have this line before the services.AddIdentity
line?
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddDbContext(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
}
This should work OK. Also please check if ApplicationDbContext
inherits from IdentityDbContext
.