-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Conversation
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>
Corrected copilot text.
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.
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.
krm240
commented
Oct 15, 2025
via email
@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.
@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:
- Which specific instructions don't match (project creation, scaffolding, or both)?
- 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.
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.
Uh oh!
There was an error while loading. Please reload this page.
Overview
This PR updates the Identity custom user data documentation to address user difficulties in customizing ASP.NET Core Identity with simple properties like
FirstNameandLastName. 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/SampleAppsample by copying and updating the 6.x sample:WebApp1.csprojto targetnet9.0NameandDOBproperties toIdentityUser2. 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:
[PersonalData]attributeExplicit MVC Instructions: The documentation previously only showed Razor Pages with a note that "instructions are similar for MVC." Now includes:
Troubleshooting Table: Maps common symptoms to likely causes and solutions:
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
>= aspnetcore-6.0to>= aspnetcore-6.0 < aspnetcore-8.04. Updated Metadata
ms.dateto 10/15/2025ai-usage: ai-assistedWhy 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
#region snippet) verified in source filesThe 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
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 OutdatedIssue 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, currentdotnet newcommands, 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 forTargetFramework. 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
dotnet new mvc -au Individual).Resolution Strategy
Create a single new
.NET 9sample and reuse its code for.NET 8:aspnetcore/security/authentication/add-user-data/samples/9.x/SampleAppTargetFramework:net9.0Rationale:
Documentation Changes (High-Level)
Metadata
ms.dateto a current date (e.g., 10/15/2025).Moniker Restructure
:::moniker range=">= aspnetcore-9.0"(primary instructions, points to 9.x sample).:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"referencing 9.x sample, noting identical code.>= aspnetcore-6.0to>= aspnetcore-6.0 < aspnetcore-8.0for legacy.New Sections / Enhancements
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