Repository navigation
AOT Compatible: ManifestVersionUtility - #7128
Merged
Merged
Conversation
zivkan
reviewed
Feb 12, 2026
zivkan
previously approved these changes
Feb 12, 2026
zivkan
left a comment
Member
There was a problem hiding this comment.
ManifestVersionUtility.cs is now half as many lines of code 👍
zivkan
approved these changes
Feb 12, 2026
martinrrm
approved these changes
Feb 12, 2026
This was referenced Feb 14, 2026
Nigusu-Allehu
added a commit
that referenced
this pull request
Feb 18, 2026
Nigusu-Allehu
added a commit
that referenced
this pull request
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Fixes:
Related: NuGet/Home#14408
Description
Previously,
GetVersionFromObjectused 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 inManifestVersions, andGetVersionFromObjectnow 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 isIEnumerable<PackageReferenceSet>, andPackageReferenceSetdoes not have aManifestVersionattribute in any of its propertiesPR Checklist