Skip to content

Use System.Text.Json source generator for .nupkg.metadata serialization #6701

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

zivkan
Copy link
Member

@zivkan zivkan commented Aug 9, 2025

Bug

Fixes: NuGet/Home#14111

Description

Use System.Text.Json source generator, rather than reflection based (de)serialization, for .nupkg.metadata files.

Note this does not make NuGet.Packaging AoT/trimming compatible, due to

return Marshal.PtrToStructure<T>(pointer);

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests existing tests cover .nupkg.metadata reading & writing. As Support AOT/Trimmed applications that would like to use NuGet libraries Home#14408 says, MSBuild property IsAotCompatible=true can give compiler warnings/errors, but MarshalUtility causes it to fail the project, so that needs to be fixed first.
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. N/A

@zivkan zivkan requested a review from a team as a code owner August 9, 2025 07:31
@zivkan zivkan requested review from jeffkl and martinrrm August 9, 2025 07:31
Copy link
Contributor

@jeffkl jeffkl left a comment

Choose a reason for hiding this comment

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

🎉

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.

JsonSerializerIsReflectionDisabled on update to Nuget.Protocols 6.13.1 in apps with JsonSerializerIsReflectionEnabledByDefault set to false
3 participants