Skip to content

AOT Compatible: ManifestVersionUtility - #7128

Merged
Nigusu-Allehu merged 4 commits into
devfrom
dev-nyenework-GetManifestVersions-AOT
Feb 13, 2026
Merged

Nigusu-Allehu merged 4 commits into
devfrom
dev-nyenework-GetManifestVersions-AOT

Conversation

@Nigusu-Allehu

@Nigusu-Allehu Nigusu-Allehu commented Feb 12, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes:
Related: NuGet/Home#14408

Description

Previously, GetVersionFromObject used reflection and recursive object graph traversal to detect [ManifestVersion] attributes at runtime and compute the manifest version dynamically.

This change removes reflection and recursion, replacing them with explicit property checks against ManifestMetadata. Version constants are centralized in ManifestVersions, and GetVersionFromObject now deterministically evaluates which properties are set to compute the correct manifest version.

This makes the implementation trimming-safe, AOT-friendly, and easier to reason about while preserving existing behavior.

Note: I removed a recursive implementation from GetVersionFromObject. The recursion is not needed with the current schema. The only list type is IEnumerable<PackageReferenceSet>, and PackageReferenceSet does not have a ManifestVersion attribute in any of its properties

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@Nigusu-Allehu Nigusu-Allehu self-assigned this Feb 12, 2026
@Nigusu-Allehu
Nigusu-Allehu marked this pull request as ready for review February 12, 2026 17:25
@Nigusu-Allehu
Nigusu-Allehu requested a review from a team as a code owner February 12, 2026 17:25
@Nigusu-Allehu
Nigusu-Allehu requested a review from zivkan February 12, 2026 20:50
zivkan
zivkan previously approved these changes Feb 12, 2026

@zivkan zivkan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ManifestVersionUtility.cs is now half as many lines of code 👍

@Nigusu-Allehu
Nigusu-Allehu merged commit a527f9e into dev Feb 13, 2026
16 checks passed
@Nigusu-Allehu
Nigusu-Allehu deleted the dev-nyenework-GetManifestVersions-AOT branch February 13, 2026 17:48
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.

3 participants