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 doesn't preserve constructors and properties on the serialized Type graph #44768

Closed
eerhardt opened this issue Nov 16, 2020 · 1 comment
Labels
area-Serialization linkable-framework Issues associated with delivering a linker friendly framework

Comments

@eerhardt
Copy link
Member

When an application is PublishTrimmed=true and TrimMode=link, and XmlSerializer is deserializing/serializing Types that are in assemblies being trimmed, properties of the serialized Types are being trimmed by the ILLinker.

In order to support XmlSerializer in a fully trimmed app, we would either need to:

  1. Get the ILLinker to support preserving properties recursively on Types
  2. Create a Source Generator for XmlSerializer

Note: this probably isn't required for 6.0, because Xamarin and Blazor WASM SDKs only trim the "core libraries", and leave any user code untrimmed by default.

@eerhardt eerhardt added area-Serialization linkable-framework Issues associated with delivering a linker friendly framework labels Nov 16, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 16, 2020
@HongGit HongGit removed the untriaged New issue has not been triaged by the area owner label Mar 25, 2021
@eerhardt
Copy link
Member Author

We marked the XmlSerializer APIs as RequiresUnreferencedCode, which will give the users an ILLink warning. Closing.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Serialization linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

No branches or pull requests

3 participants