-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Address remaining warnings from DataContractSerialization #51200
Conversation
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @tannergooding, @sbomer Issue DetailsContributes to #45623 This Resolves the remaining warnings on System.Private.DataContractSerialization.
In reply to: 819084419 |
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. In reply to: 819084428 |
...stem.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs
Outdated
Show resolved
Hide resolved
...Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs
Outdated
Show resolved
Hide resolved
...Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs
Outdated
Show resolved
Hide resolved
...Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs
Outdated
Show resolved
Hide resolved
...Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs
Outdated
Show resolved
Hide resolved
...ries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMember.cs
Outdated
Show resolved
Hide resolved
....Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs
Outdated
Show resolved
Hide resolved
...vate.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatGeneratorStatics.cs
Outdated
Show resolved
Hide resolved
...ivate.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs
Outdated
Show resolved
Hide resolved
...System.Private.DataContractSerialization/src/System/Runtime/Serialization/AccessorBuilder.cs
Outdated
Show resolved
Hide resolved
...System.Private.DataContractSerialization/src/System/Runtime/Serialization/AccessorBuilder.cs
Outdated
Show resolved
Hide resolved
...System.Private.DataContractSerialization/src/System/Runtime/Serialization/AccessorBuilder.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just some minor-ish comments.
...ystem.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionReader.cs
Outdated
Show resolved
Hide resolved
...System.Private.DataContractSerialization/src/System/Runtime/Serialization/AccessorBuilder.cs
Outdated
Show resolved
Hide resolved
...System.Private.DataContractSerialization/src/System/Runtime/Serialization/AccessorBuilder.cs
Outdated
Show resolved
Hide resolved
...Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs
Outdated
Show resolved
Hide resolved
...ataContractSerialization/src/System/Runtime/Serialization/Json/DataContractJsonSerializer.cs
Outdated
Show resolved
Hide resolved
....Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs
Outdated
Show resolved
Hide resolved
....Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs
Outdated
Show resolved
Hide resolved
|
||
public abstract class XmlObjectSerializer | ||
{ | ||
[RequiresUnreferencedCode(DataContractJsonSerializer.SerializerTrimmerWarning)] | ||
public abstract void WriteStartObject(XmlDictionaryWriter writer, object? graph); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't necessarily true. This class is public abstract and may not require unreferenced code. WCF carries an implementation of this abstract type and customers might in their own code too. The WCF implementation does delegate work to XmlSerializer (which doesn't implement this abstract class) and doesn't reference anything from DCS or DCJS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way the API is shaped - object? graph
- doesn't lead to being trim compatible. The trimmer has no way of knowing statically which Types are being passed into WriteStartObject
. Therefore, it doesn't know what members on what Types should be preserved.
Even if you looked at the type of variables:
Customer c = GetSomeCustomer();
serializer.WriteStartObject(writer, c);
You don't know statically if c
is concretely a Customer
or a type derived from Customer
.
@StephenMolloy as he owns DCS and DCJS |
...System.Private.DataContractSerialization/src/System/Runtime/Serialization/AccessorBuilder.cs
Show resolved
Hide resolved
...stem.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs
Outdated
Show resolved
Hide resolved
Hello @joperezr! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Contributes to #45623
This Resolves the remaining warnings on System.Private.DataContractSerialization.
cc: @eerhardt @vitek-karas