0
votes

I made a MVC project, that includes 2 projects.

  1. class library (.NET Core) - i have my models and services/options here
  2. ASP.NET Core Web Application - Controllers, views here

I want to add identity to my project. So i found the following NuGet Packages

  1. Microsoft.AspNetCore.Identity.EntityFrameworkCore
  2. Microsoft.AspNetCore.Identity.UI
  3. Microsoft.Extensions.Identity.Stores

I used public class NameDbContext : IdentityDbContext<IdentityUser> in my DbContext class.

I clicked Add on the Web-project -> choose "New Scaffolded Item" -> pictures below

What i want to choose

The Error i get

Any ideas?

EDIT:

i can see in my database that the tables are created, after the NuGet Packages and the add-migration & update-database commands that followed.

I also tried my DbContext class without the <IdentityUser> like this

public class NameDbContext : IdentityDbContext

1
You can try to updated all NuGet packages from Tools->Nuget Package Manager -> Manage NuGet Packages for Solution -> Updates tab -> Update All. - Yinqiu
This seems to work, thank you. I have encountered another problem with setting it up (display on the app when i debug), but i'll try to work it out on my own for now. I used older versions because i am following a project. The devil is in the details. - user14669223
Hi @Syrrah,If my answer is helpful,can you accept it as answer?Thanks! And if there is any other question,Welcome back to ask questions again. - Yinqiu
It adds the scaffold but there is no display of the login/logout & register buttons. I have chosen the layout page, but nothing. I overcame half the problem, which i thank you for it. Hence that's the reason i didn't mark it (yet at least) as an answer. - user14669223
You can describe your problem in detail and provide more information so that we can solve your problem. - Yinqiu

1 Answers

0
votes

You can try to updated all NuGet packages from Tools->Nuget Package Manager -> Manage NuGet Packages for Solution -> Updates tab -> Update All.