Skip to content

Make CredentialDescription AOT-compatible via C# 14 extension properties (v11.0.0)#238

Merged
bgavrilMS merged 20 commits intomainfrom
copilot/make-credentialdescription-aot-compatible
Feb 3, 2026
Merged

Make CredentialDescription AOT-compatible via C# 14 extension properties (v11.0.0)#238
bgavrilMS merged 20 commits intomainfrom
copilot/make-credentialdescription-aot-compatible

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

AOT/NativeAOT Compatibility for CredentialDescription (.NET 10+) - v11.0.0

✅ Implementation Complete - All Feedback Addressed

  • Version bumped to 11.0.0
  • Changelog with troubleshooting guidance
  • C# 14 extension properties
  • AOT test project added
  • CI pipeline with AOT tests
  • Methods changed to protected internal
  • Copy constructor simplified
  • CA1024 pragma added
  • Documentation refined - Clarifies C# 14 available on all TFMs, used on .NET 10+ by library design

📊 Implementation

Core Changes:

  • CredentialDescription.cs - Conditional compilation, protected internal methods
  • CredentialDescriptionExtensions.cs - C# 14 extension properties (.NET 10+ by design)
  • Directory.Build.props - LangVersion 14, Version 11.0.0
  • PublicAPI files - Updated for net10.0
  • changelog.md - Breaking change documentation with troubleshooting
  • Microsoft.Identity.Abstractions.AotTests - AOT validation project
  • .github/workflows/dotnetcore.yml - Automated AOT testing

🎯 Design Decisions

Extension Properties Implementation:

  • C# 14 extension properties work on any target framework (language feature)
  • This library exposes them only on .NET 10+ by design
  • Reason: Avoid binary breaking changes on older frameworks
  • Older TFMs keep regular properties (backward compatible)

Why Protected Internal:

  • Derived classes in other assemblies need access to methods
  • Cannot use base.Certificate with extension properties
  • Enables inheritance scenarios (e.g., CertificateDescription in Microsoft.Identity.Web)

Why CA1024 Pragma:

  • Get* methods intentionally not properties
  • Support extension property pattern
  • Prevents analyzer warnings

Status: Ready for merge
Version: 11.0.0 | C# Version: 14+
TFMs: net10.0, net9.0, net8.0, net462, netstandard2.0/2.1


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 8 commits February 2, 2026 23:15
…cription

Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
…nsion properties

Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Copilot AI changed the title [WIP] Make CredentialDescription and Abstractions AOT-compatible with extension properties Make CredentialDescription AOT-compatible via C# 15 extension properties Feb 2, 2026
Copilot AI requested a review from jmprieur February 2, 2026 23:29
Copy link
Contributor

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot this is a great start. I left some comments.
Also we need to increase the major version as this is a public API binary breaking change (even if this should be source compatible)

Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 3, 2026

@copilot this is a great start. I left some comments.
Also we need to increase the major version as this is a public API binary breaking change (even if this should be source compatible)

Addressed all feedback in commit 3b6093a:

  • Reverted NuGet.config changes (was only needed for local network issues)
  • Changed LangVersion from preview to 14 (C# 14 is released)
  • Updated all documentation to reference C# 14 instead of C# 15
  • Explained the performance optimization in Id property

Regarding the major version: the changelog shows we're already at version 10.0.0, which is a major bump from 9.x. The changes are in the 10.0.0 section. Should we bump to 11.0.0 instead?

Copilot AI changed the title Make CredentialDescription AOT-compatible via C# 15 extension properties Make CredentialDescription AOT-compatible via C# 14 extension properties Feb 3, 2026
Copilot AI requested a review from jmprieur February 3, 2026 01:02
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Copilot AI changed the title Make CredentialDescription AOT-compatible via C# 14 extension properties Make CredentialDescription AOT-compatible via C# 14 extension properties (v11.0.0) Feb 3, 2026
Copilot AI requested a review from jmprieur February 3, 2026 01:33
@jmprieur jmprieur marked this pull request as ready for review February 3, 2026 01:44
Copy link
Member

@bgavrilMS bgavrilMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with comments.

…, clarify docs

Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Copy link
Contributor

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot, please check the new comments where i tagged you

…age limitation

Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Copy link
Contributor

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot : another round of comments to address, and I think we'll be good

…y library design

Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
@bgavrilMS bgavrilMS merged commit 9cf4db7 into main Feb 3, 2026
6 checks passed
@bgavrilMS bgavrilMS deleted the copilot/make-credentialdescription-aot-compatible branch February 3, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants