Skip to content

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

Merged
eerhardt merged 3 commits into
dotnet:masterfrom
eerhardt:Fix41389
Dec 4, 2020
Merged

eerhardt merged 3 commits into
dotnet:masterfrom
eerhardt:Fix41389

Conversation

@eerhardt

Copy link
Copy Markdown
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
Copy Markdown
Member Author

@StephenMolloy @HongGit - any feedback here?

@StephenMolloy

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@StephenMolloy StephenMolloy left a comment

Copy link
Copy Markdown
Contributor

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