Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update Identity custom user data documentation for .NET 8/9 with MVC instructions and troubleshooting #36222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
Copilot wants to merge 4 commits into main
base: main
Choose a base branch
Loading
from copilot/customize-identity-user-data

Conversation

Copy link
Contributor

Copilot AI commented Oct 15, 2025
edited by github-actions bot
Loading

Overview

This PR updates the Identity custom user data documentation to address user difficulties in customizing ASP.NET Core Identity with simple properties like FirstName and LastName. The documentation was outdated (last updated March 2022) and lacked explicit guidance for .NET 8/9 and MVC projects.

Closes #[issue number]

Changes Made

1. Added .NET 9 Sample Code

Created a new 9.x/SampleApp sample by copying and updating the 6.x sample:

  • Updated WebApp1.csproj to target net9.0
  • Updated all Identity and EF Core package references to version 9.0.0
  • Sample demonstrates adding custom Name and DOB properties to IdentityUser

2. Added .NET 9 and .NET 8 Moniker Sections

Both new sections include:

Quick Start Checklist: A high-level 6-step guide for the common scenario of adding two custom properties:

  1. Create ASP.NET Core project with Individual Accounts
  2. Scaffold Identity pages
  3. Add custom properties with [PersonalData] attribute
  4. Update Register and Manage pages
  5. Create and apply migration
  6. Test the application

Explicit MVC Instructions: The documentation previously only showed Razor Pages with a note that "instructions are similar for MVC." Now includes:

  • Separate subsections for Razor Pages and MVC project creation
  • Both Visual Studio and .NET CLI commands for each
  • Clear explanation that Identity UI uses Razor Pages even in MVC projects

Troubleshooting Table: Maps common symptoms to likely causes and solutions:

  • Custom fields not appearing in forms
  • Data not persisting to database
  • Fields missing from downloaded personal data
  • Build errors after scaffolding

For .NET 8: Includes a prominent NOTE that the code is identical to .NET 9 (only the target framework differs), so both versions reference the same 9.x sample to avoid duplication.

3. Updated Existing Sections

  • Changed .NET 6.x moniker range from >= aspnetcore-6.0 to >= aspnetcore-6.0 < aspnetcore-8.0
  • Fixed grammar issues throughout all sections:
    • "want to it match" → "want it to match"
    • "layout file" → "layout file" (removed extra space)
    • "instruction" → "instructions"
    • "examined" → "examine"

4. Updated Metadata

  • Set ms.date to 10/15/2025
  • Added ai-usage: ai-assisted
  • Reordered metadata alphabetically per Microsoft Learn guidelines

Why These Changes Matter

For .NET 8/9 Users: The documentation now explicitly covers current LTS and STS versions with up-to-date sample code.

For MVC Developers: No more confusion about whether the guidance applies—explicit instructions are provided, along with clarification that Identity UI is implemented as Razor Pages regardless of project type.

For Beginners: The Quick Start checklist provides a mental model before diving into details, and the troubleshooting table helps diagnose common mistakes.

Validation

  • All code snippet references point to valid files in the 9.x sample
  • Snippet regions (#region snippet) verified in source files
  • Moniker ranges validated (no overlaps, covers all versions)
  • Metadata follows Microsoft Learn standards
  • Grammar improvements enhance professional quality

The GitHub workflow will validate the documentation build when this PR is reviewed.

Original prompt

This section details on the original issue you should resolve

<issue_title>MVC Customize Identity Issue</issue_title>
<issue_description>### Description

Hi, I have been struggling with adding FirstName LastName custom data into an identityUser customization. Not looking for a detailed, response, but hi level. If I create a new project (MVC Framework 8, authentication type individuals) and started from there, should this work?
Do you have a tutorial that starts from there? Would be nice if not. been trying to do this for min 2-3 years, and I keep giving up because I never can get it to work.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/security/authentication/add-user-data?view=aspnetcore-9.0&tabs=visual-studio

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/authentication/add-user-data.md

Document ID

cd157d04-d596-83fa-6edb-24d52193eb34

Platform Id

6617dcc3-4828-8b6c-4b70-b2be2a7b9233

Article author

@wadepickett

Metadata

  • ID: 431df4fc-4168-cc8f-d053-9b264d2971c1
  • PlatformId: 6617dcc3-4828-8b6c-4b70-b2be2a7b9233
  • Service: aspnet-core
  • Sub-service: security

Related Issues</issue_description>

Comments on the Issue (you are @copilot in this section)

@wadepickett @krm240, you are right, this topic needs some help. Sorry to hear about the awful experience. I didn't author the original article, but I'm checking through to see how we can improve it. Thanks very much for taking the time to let us know. @wadepickett # Issue Analysis: Identity Custom User Data Guidance Outdated

Issue Summary

This is a valid issue.

Developers often need to just add simple custom properties (FirstName, LastName) to an ASP.NET Core Identity user in a newly created MVC (.NET 8 / 9, Individual Accounts) project. The current article’s sample and narrative focus on a Razor Pages template (6.x-era) and only mentions that instructions are "similar" for MVC, without explicitly showing the modern MVC & Razor Pages templates, current dotnet new commands, or a concise high-level checklist. The article is dated (ms.date 03/15/2022), has no moniker section for .NET 7/8/9, and therefore appears stale. This creates friction for developers expecting direct, up-to-date guidance.

Decision: Introduce a new .NET 9 (current) sample (add-user-data/samples/9.x/SampleApp) and reuse it for .NET 8 by noting that the code is identical except for TargetFramework. This avoids creating a separate 8.x sample folder and keeps future maintenance minimal.

Scope Validation

Within article intent: Yes. The doc’s purpose is to show how to add, download, and delete custom user data with Identity. Adding explicit guidance for MVC, current versions, and a minimal property scenario (First/Last name) fits squarely within scope.

Target Framework / Tooling (Current vs. Document)

Document currently: monikers up to >=6.0 (lines 25–170 in existing version), plus older 3.x and 2.x sections.
Needed: Add >= aspnetcore-9.0 (primary), add >= aspnetcore-8.0 < aspnetcore-9.0 referencing the 9.x sample, retain/adjust >=6.0 <8.0 as legacy. Update ms.date.

Root Causes of User Difficulty

  1. No explicit .NET 8/9 mention; perceived obsolescence.
  2. Lack of explicit MVC template steps (dotnet new mvc -au Individual).
  3. No quick-start "just add 2 properties" checklist.
  4. Identity Razor Pages architecture not clearly reiterated for MVC projects.
  5. Minor grammar issues reduce confidence (e.g., "want to it match", "layout file", past tense in bullet lists).
  6. No updated sample demonstrating current LTS/STS.

Resolution Strategy

Create a single new .NET 9 sample and reuse its code for .NET 8:

  • Folder: aspnetcore/security/authentication/add-user-data/samples/9.x/SampleApp
  • TargetFramework: net9.0
  • Snippets referenced by both .NET 9 and .NET 8 monikers; .NET 8 moniker adds a note that code is identical.

Rationale:

  • Identity customization steps unchanged between 8 and 9.
  • Minimizes duplication and maintenance.
  • Improves credibility by presenting a "current" sample.

Documentation Changes (High-Level)

  1. Metadata

    • Update ms.date to a current date (e.g., 10/15/2025).
  2. Moniker Restructure

    • Add :::moniker range=">= aspnetcore-9.0" (primary instructions, points to 9.x sample).
    • Add :::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0" referencing 9.x sample, noting identical code.
    • Adjust existing >= aspnetcore-6.0 to >= aspnetcore-6.0 < aspnetcore-8.0 for legacy.
    • Leave 3.x and <3.0 as-is (with grammar fixes).
  3. New Sections / Enhancements

    • "Quick checklist" for adding two properties (FirstName, LastName).
    • Explicit project creation instructions for both Razor Pages ...

Fixes #36213


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Internal previews

📄 File 🔗 Preview link
aspnetcore/security/authentication/add-user-data.md Add, download, and delete custom user data to Identity in an ASP.NET Core project
aspnetcore/security/authentication/add-user-data/samples/9.x/SampleApp/wwwroot/lib/jquery-validation/LICENSE.md aspnetcore/security/authentication/add-user-data/samples/9.x/SampleApp/wwwroot/lib/jquery-validation/LICENSE

Copilot AI and others added 2 commits October 15, 2025 16:01
Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com>
...checklist, troubleshooting, and fix grammar issues
Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com>
Copilot AI changed the title (削除) [WIP] Add FirstName LastName custom data to identityUser (削除ここまで) (追記) Update Identity custom user data documentation for .NET 8/9 with MVC instructions and troubleshooting (追記ここまで) Oct 15, 2025
Copilot AI requested a review from wadepickett October 15, 2025 16:13
Copilot finished work on behalf of wadepickett October 15, 2025 16:13
Copy link
Contributor

wadepickett commented Oct 15, 2025
edited
Loading

Notes: Wade's AI issue handling tests:

For this issue + PR:

  • AI generated pre-run analysis run to prep Copilot to be more successful with what would be a complicated PR since doc and sample versioning, data migration scenario, two app architectures (Razor Pages + MVC) multiple IDE's were involved along with full app samples. (GitHub Copilot + GPT-5 +repo level instruction files)

  • AI for PR Generation, by simply assigning Copilot to the issue. (GitHub Copilot + default model + Repo level AI instruction)

Verified the app generated also followed our rules for not using minified versions of assets as instructed (bootstrap, jquery) since our .gitignore file excludes them. This AI gen PR followed the new instructions on that perfectly here.

  • Human modification:
    The AI gen pre-analysis wanted to generate complete samples for every version. While this technically was an OK solution, there were no changes in code required between several .NET versions related to the needed sample, so I corrected the AI gen pre-analysis to just do one full app sample (~560 files) as opposed (150+ files)

  • Automated build was run successfully without warnings.

Corrections to AI draft:
The app sample is not using the compressed version of bootstrap

Next:

  • Needs human test through in review phase for doc plus samples.

Copy link
Contributor

wadepickett commented Oct 15, 2025
edited
Loading

Reminder for myself: @krm240 who created the issue, was kind to offer to test through the new steps on the resulting topic update for useability. Loop in krm240 when this is ready to be reviewed.

Copy link

krm240 commented Oct 15, 2025 via email

Correct, once ready, I will gladly test the process for you, But be aware, I am a simple programmer. So, if not clear, may state an issue for me that is not an issue for u. From: Wade Pickett ***@***.***> Sent: October 15, 2025 3:20 PM To: dotnet/AspNetCore.Docs ***@***.***> Cc: krm240 ***@***.***>; Mention ***@***.***> Subject: Re: [dotnet/AspNetCore.Docs] Update Identity custom user data documentation for .NET 8/9 with MVC instructions and troubleshooting (PR #36222) <https://avatars.githubusercontent.com/u/10985336?s=20&v=4> wadepickett left a comment (dotnet/AspNetCore.Docs#36222) <#36222 (comment)> Reminder, @krm240 <https://github.com/krm240> who created the issue, was kind to offer to test through the new steps on the resulting topic update for useability. Loop in krm240 when this is ready to be reviewed. — Reply to this email directly, view it on GitHub <#36222 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AANXPDUFCB4LOKEZPBAWWUL3X3CCXAVCNFSM6AAAAACJIYIX6GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMBYGUYTGNZRGE> . You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AANXPDXERR4DBZUXCRDAXA33X3CCXA5CNFSM6AAAAACJIYIX6GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTWLFHFK6.gif> Message ID: ***@***.*** ***@***.***> >

Copy link
Contributor

@copilot, the instructions for Visual Studio do not match the steps required in the latest UI of Visual Studio Professional Insiders Edition 2026. Update to match. If unsure of how to do this, say so.

Copy link
Contributor Author

Copilot AI commented Oct 16, 2025

@copilot, the instructions for Visual Studio do not match the steps required in the latest UI of Visual Studio Professional Insiders Edition 2026. Update to match. If unsure of how to do this, say s...

I need clarification on the specific Visual Studio 2026 UI changes. Could you provide details on:

  1. Which specific instructions don't match (project creation, scaffolding, or both)?
  2. What are the actual steps in VS 2026 Professional Insiders Edition?

For example:

  • Has the menu structure changed (File > New > Project)?
  • Are the template names different?
  • Has the authentication configuration dialog changed?
  • Are there new or different options in the scaffolder?

Without access to VS 2026 Professional Insiders Edition or specific details about the UI changes, I cannot accurately update the instructions. Please provide the correct steps or screenshots of the new UI flow.

Copilot AI requested a review from wadepickett October 16, 2025 05:13
Copilot finished work on behalf of wadepickett October 16, 2025 05:13
Copy link
Contributor

wadepickett commented Oct 16, 2025
edited
Loading

Notes: Wade’s AI Issue-Handling Tests
Copilot Instruction Improvement Opportunity

Problem:
Copilot attempted step by step instructions for a new project set up and Identity scaffolding using the latest Visual Studio version. Even though Copilot wasn’t expected to be aware of recent changes, it made an attempt without flagging low confidence. When asked directly, it correctly indicated low confidence, confirming that it simply wasn’t up to date (as expected).

Improvement opportunity:
Enhance Copilot’s instructions so that it proactively flags low-confidence areas, giving reviewers or collaborators a clear heads-up, especially when handling new or recently updated IDE workflows

In this case for this PR, the Visual Studio instruction will need to be entered correctly in a commit by a human author. The CLI instruction looks good however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@wadepickett wadepickett Awaiting requested review from wadepickett

At least 1 approving review is required to merge this pull request.

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

MVC Customize Identity Issue

AltStyle によって変換されたページ (->オリジナル) /