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

XmlSerializer.Serialize doesn't work when using TrimMode=link #44772

Merged
merged 3 commits into from
Dec 4, 2020

Conversation

eerhardt
Copy link
Member

Make XmlSerializer work correctly with ILLinker trimming.

  1. Use constant BindingFlags to work around Non constant BindingFlags causes ILLinker to trim required methods linker#1617
  2. Annotate CodeGenerator.CreateTypeBuilder correctly to preserve base class members

Fix #41389

cc @rolfbjarne @marek-safar

Make XmlSerializer work correctly with ILLinker trimming.

1. Use constant BindingFlags to work around dotnet/linker#1617
2. Annotate CodeGenerator.CreateTypeBuilder correctly to preserve base class members

Fix dotnet#41389
Fix ILLinker suppresions.
@eerhardt
Copy link
Member Author

@StephenMolloy @HongGit - any feedback here?

@StephenMolloy
Copy link
Member

Looks fine to me. Since we've been having conversations about serializer trimmailbity... @mconnew, have you had a chance to review this PR?

@eerhardt
Copy link
Member Author

@StephenMolloy @mconnew @HongGit - If you approve of these changes, can someone mark the PR as "approved"? I cannot merge it without an approving review.

Copy link
Member

@StephenMolloy StephenMolloy left a comment

Choose a reason for hiding this comment

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

lgtm

@eerhardt eerhardt merged commit be9d38c into dotnet:master Dec 4, 2020
@eerhardt eerhardt deleted the Fix41389 branch December 4, 2020 02:14
@ghost ghost locked as resolved and limited conversation to collaborators Jan 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XmlSerializer.Serialize doesn't work when using TrimMode=link
5 participants