question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scaffold Identity omits custom ApplicationUser

See original GitHub issue

From @Ponant on July 19, 2018 15:25

Works

  1. New project 2.1 MVC with no auth
  2. Scaffold identity and choose the plus button for the user class

scaffoldidentity21

The resulting code is expected because it refers to ApplicationUser

public class ApplicationDbContext : IdentityDbContext<ApplicationUser> services.AddDefaultIdentity<ApplicationUser>()

Does not work

  1. New project 2.1 MVC with no auth
  2. Create a class ApplicationUser that derives from IdentityUser public class ApplicationUser : IdentityUser
  3. Scaffold identity and choose the dropdown button for the user class

scaffoldidentity21bug

The resulting code is unexpected because it refers to IdentityUser. ApplicationUser is totally ignored

public class ApplicationDbContext : IdentityDbContext<IdentityUser> services.AddDefaultIdentity<IdentityUser>()

Bug?

Copied from original issue: aspnet/Identity#1886

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
seancpeterscommented, Jul 19, 2018

@Ponant - I’ve tracked down the root cause of this issue - it’s in the VS integration of the identity scaffolder. When I know which release the fix will be available in, I’ll update you here.

1reaction
egocaribcommented, Jul 19, 2022

Yes, I also have been struggling with this today. I had to scaffold and then manually find/replace all instances of IdentityUser with my custom ApplicationUser in the scaffolded files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Scaffold the login/register UI for the customized ...
From the left pane of the Add Scaffold dialog, select Identity > Add . Now I can select with scaffolded items and the...
Read more >
Scaffold Identity in ASP.NET Core projects
Learn how to scaffold Identity in an ASP. ... If you have an existing, customized layout page for Identity ( _Layout.cshtml ), select...
Read more >
Can not scaffold Views based on IdentityUser model class.
I want to scaffold list/edit/create views for IdentityUser database. ... custom ApplicationUser , which is your process of custom scaffold ...
Read more >
Adding Authentication and Authorisation to ASP.NET Core ...
In this blog post, we explain how to implement authentication and authorisation capabilities to an ASP.NET Core web application by exploring ...
Read more >
Identity model customization in ASP.NET Core
This article describes how to customize the underlying Entity Framework Core data model for ASP.NET Core Identity.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found