Skip to content
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

Backport XmlSerializer reflection changes to 8.0-staging #112320

Conversation

StephenMolloy
Copy link
Member

Backport of #111723 to release/8.0-staging

Customer Impact

  • Customer reported
  • Found internally

Fixes #107252, #108432. A customer reported a couple of inconsistent behaviors between the usual ILGen-based XmlSerializer and the reflection-based XmlSerializer that they got switched over to because iOS projects don't support dynamic code by default. This PR addresses the null-vs-empty collections issue as well as the sub-types as collection items issue. A third issue regarding xml/type-mapping of hidden/overridden members that was included in the .Net 10 PR is not part of this backport since it touches code that the standard ILGen serializer also uses and we did not want to introduce any risk there.

Regression

  • Yes
  • No

Testing

Several tests were added to explore the reported scenarios exactly as well as some tangential exploration.

Risk

Low - These changes affect the reflection-based serializer only. We already know the reflection-based serializer is not yet up to parity with the ILGen serializer, but it is only used as a fallback in a minority of cases. The scenarios being changed here have had several tests added to explore potential impacts and ensure our changes are only doing what we intend.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

@StephenMolloy StephenMolloy marked this pull request as ready for review February 10, 2025 23:02
@HongGit HongGit added the Servicing-approved Approved for servicing release label Feb 11, 2025
@carlossanlop carlossanlop removed the Servicing-consider Issue for next servicing release review label Feb 11, 2025
@carlossanlop
Copy link
Member

/ba-g The unknown build failure is a build timeout, unrelated to this change.

@carlossanlop carlossanlop merged commit f6dd202 into dotnet:release/8.0-staging Feb 11, 2025
119 of 126 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Serialization Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants