Annotate System.Runtime.Serialization for AOT warnings (#74663)
authorTlakaelel Axayakatl Ceja <tlakaelel_axayakatl@outlook.com>
Mon, 29 Aug 2022 15:21:30 +0000 (08:21 -0700)
committerGitHub <noreply@github.com>
Mon, 29 Aug 2022 15:21:30 +0000 (08:21 -0700)
Annotate System.Runtime.Serialization for AOT warnings
Modify current RUC warnings where they use the word `Type` starting with uppercase to just `type` to be consistent with the rest of the framework

13 files changed:
src/libraries/System.Data.Common/ref/System.Data.Common.cs
src/libraries/System.Data.Common/src/System/Data/DataSet.cs
src/libraries/System.Runtime.Serialization.Formatters/ref/System.Runtime.Serialization.Formatters.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatter.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.Core.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.PlatformNotSupported.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryParser.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/IFormatter.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/SerializationObjectManager.cs
src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.txt

index e46b17a..b15070d 100644 (file)
@@ -492,8 +492,10 @@ namespace System.Data
     public partial class DataSet : System.ComponentModel.MarshalByValueComponent, System.ComponentModel.IListSource, System.ComponentModel.ISupportInitialize, System.ComponentModel.ISupportInitializeNotification, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable
     {
         public DataSet() { }
+        [System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("Members from serialized types may use dynamic code generation.")]
         [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Members from serialized types may be trimmed if not referenced directly.")]
         protected DataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
+        [System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("Members from serialized types may use dynamic code generation.")]
         [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Members from serialized types may be trimmed if not referenced directly.")]
         protected DataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, bool ConstructSchema) { }
         public DataSet(string dataSetName) { }
@@ -548,6 +550,7 @@ namespace System.Data
         public static System.Xml.Schema.XmlSchemaComplexType GetDataSetSchema(System.Xml.Schema.XmlSchemaSet? schemaSet) { throw null; }
         public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
         protected virtual System.Xml.Schema.XmlSchema? GetSchemaSerializable() { throw null; }
+        [System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("Members from serialized types may use dynamic code generation.")]
         [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Members from serialized types may be trimmed if not referenced directly.")]
         protected void GetSerializationData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
         [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Members from serialized types may be trimmed if not referenced directly.")]
index d65d72b..f08e12b 100644 (file)
@@ -33,6 +33,7 @@ namespace System.Data
     [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.NonPublicConstructors)] // needed by Clone() to preserve derived ctors
     public class DataSet : MarshalByValueComponent, IListSource, IXmlSerializable, ISupportInitializeNotification, ISerializable
     {
+        internal const string RequiresDynamicCodeMessage = "Members from serialized types may use dynamic code generation.";
         internal const string RequiresUnreferencedCodeMessage = "Members from serialized types may be trimmed if not referenced directly.";
         private const string KEY_XMLSCHEMA = "XmlSchema";
         private const string KEY_XMLDIFFGRAM = "XmlDiffGram";
@@ -217,6 +218,7 @@ namespace System.Data
 
         // Deserialize all the tables data of the dataset from binary/xml stream.
         // 'instance' method that consumes SerializationInfo
+        [RequiresDynamicCode(RequiresDynamicCodeMessage)]
         [RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)]
         protected void GetSerializationData(SerializationInfo info, StreamingContext context)
         {
@@ -238,6 +240,7 @@ namespace System.Data
 
 
         // Deserialize all the tables schema and data of the dataset from binary/xml stream.
+        [RequiresDynamicCode(RequiresDynamicCodeMessage)]
         [RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)]
         [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:ReflectionToRequiresUnreferencedCode",
             Justification = "CreateInstanceOfThisType's use of GetType uses only the parameterless constructor, but the annotations preserve all non-public constructors causing a warning for the serialization constructors. Those constructors won't be used here.")]
@@ -245,6 +248,7 @@ namespace System.Data
         {
         }
 
+        [RequiresDynamicCode(RequiresDynamicCodeMessage)]
         [RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)]
         [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:ReflectionToRequiresUnreferencedCode",
             Justification = "CreateInstanceOfThisType's use of GetType uses only the parameterless constructor, but the annotations preserve all non-public constructors causing a warning for the serialization constructors. Those constructors won't be used here.")]
@@ -386,6 +390,7 @@ namespace System.Data
         }
 
         // Deserialize all the tables - marked internal so that DataTable can call into this
+        [RequiresDynamicCode(RequiresDynamicCodeMessage)]
         [RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)]
         internal void DeserializeDataSet(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat, SchemaSerializationMode schemaSerializationMode)
         {
@@ -396,6 +401,7 @@ namespace System.Data
         }
 
         // Deserialize schema.
+        [RequiresDynamicCode(RequiresDynamicCodeMessage)]
         [RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)]
         private void DeserializeDataSetSchema(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat, SchemaSerializationMode schemaSerializationMode)
         {
@@ -455,6 +461,7 @@ namespace System.Data
         }
 
         // Deserialize all  data.
+        [RequiresDynamicCode(RequiresDynamicCodeMessage)]
         [RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)]
         private void DeserializeDataSetData(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat)
         {
index ecfda2d..d1ebf7e 100644 (file)
@@ -16,12 +16,13 @@ namespace System.Runtime.Serialization
         public abstract System.Runtime.Serialization.StreamingContext Context { get; set; }
         public abstract System.Runtime.Serialization.ISurrogateSelector? SurrogateSelector { get; set; }
         [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("BinaryFormatter serialization uses dynamic code generation, the type of objects being processed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
         public abstract object Deserialize(System.IO.Stream serializationStream);
         protected virtual object? GetNext(out long objID) { throw null; }
         protected virtual long Schedule(object? obj) { throw null; }
         [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
         public abstract void Serialize(System.IO.Stream serializationStream, object graph);
         protected abstract void WriteArray(object obj, string name, System.Type memberType);
         protected abstract void WriteBoolean(bool val, string name);
@@ -91,10 +92,11 @@ namespace System.Runtime.Serialization
         System.Runtime.Serialization.StreamingContext Context { get; set; }
         System.Runtime.Serialization.ISurrogateSelector? SurrogateSelector { get; set; }
         [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("BinaryFormatter serialization uses dynamic code generation, the type of objects being processed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
         object Deserialize(System.IO.Stream serializationStream);
         [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
         void Serialize(System.IO.Stream serializationStream, object graph);
     }
     public partial interface ISerializationSurrogate
@@ -117,23 +119,23 @@ namespace System.Runtime.Serialization
     public partial class ObjectManager
     {
         public ObjectManager(System.Runtime.Serialization.ISurrogateSelector? selector, System.Runtime.Serialization.StreamingContext context) { }
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
         public virtual void DoFixups() { }
         public virtual object? GetObject(long objectID) { throw null; }
         public virtual void RaiseDeserializationEvent() { }
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
         public void RaiseOnDeserializingEvent(object obj) { }
         public virtual void RecordArrayElementFixup(long arrayToBeFixed, int index, long objectRequired) { }
         public virtual void RecordArrayElementFixup(long arrayToBeFixed, int[] indices, long objectRequired) { }
         public virtual void RecordDelayedFixup(long objectToBeFixed, string memberName, long objectRequired) { }
         public virtual void RecordFixup(long objectToBeFixed, System.Reflection.MemberInfo member, long objectRequired) { }
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
         public virtual void RegisterObject(object obj, long objectID) { }
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
         public void RegisterObject(object obj, long objectID, System.Runtime.Serialization.SerializationInfo info) { }
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
         public void RegisterObject(object obj, long objectID, System.Runtime.Serialization.SerializationInfo? info, long idOfContainingObj, System.Reflection.MemberInfo? member) { }
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
         public void RegisterObject(object obj, long objectID, System.Runtime.Serialization.SerializationInfo? info, long idOfContainingObj, System.Reflection.MemberInfo? member, int[]? arrayIndex) { }
     }
     public abstract partial class SerializationBinder
@@ -146,7 +148,7 @@ namespace System.Runtime.Serialization
     {
         public SerializationObjectManager(System.Runtime.Serialization.StreamingContext context) { }
         public void RaiseOnSerializedEvent() { }
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("SerializationObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("SerializationObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
         public void RegisterObject(object obj) { }
     }
     public partial class SurrogateSelector : System.Runtime.Serialization.ISurrogateSelector
@@ -196,10 +198,11 @@ namespace System.Runtime.Serialization.Formatters.Binary
         public System.Runtime.Serialization.ISurrogateSelector? SurrogateSelector { get { throw null; } set { } }
         public System.Runtime.Serialization.Formatters.FormatterTypeStyle TypeFormat { get { throw null; } set { } }
         [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("BinaryFormatter serialization uses dynamic code generation, the type of objects being processed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
         public object Deserialize(System.IO.Stream serializationStream) { throw null; }
         [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]
+        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
         public void Serialize(System.IO.Stream serializationStream, object graph) { }
     }
 }
index 2f03c80..a9438b2 100644 (file)
@@ -3,6 +3,7 @@
     <TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Android</TargetFrameworks>
     <!-- ILLinker settings -->
     <ILLinkDirectory>$(MSBuildThisFileDirectory)ILLink\</ILLinkDirectory>
+    <EnableAOTAnalyzer>true</EnableAOTAnalyzer>
   </PropertyGroup>
   <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
   <PropertyGroup>
index 8748e69..7d14ebc 100644 (file)
@@ -21,6 +21,7 @@ namespace System.Runtime.Serialization
         }
 
         [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [RequiresDynamicCode(IFormatter.RequiresDynamicCodeMessage)]
         [RequiresUnreferencedCode(IFormatter.RequiresUnreferencedCodeMessage)]
         public abstract object Deserialize(Stream serializationStream);
 
index 5021aaa..d495d26 100644 (file)
@@ -9,6 +9,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
     public sealed partial class BinaryFormatter : IFormatter
     {
         [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [RequiresDynamicCode(IFormatter.RequiresDynamicCodeMessage)]
         [RequiresUnreferencedCode(IFormatter.RequiresUnreferencedCodeMessage)]
         public object Deserialize(Stream serializationStream)
         {
index 1e19497..b212e94 100644 (file)
@@ -9,6 +9,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
     public sealed partial class BinaryFormatter : IFormatter
     {
         [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [RequiresDynamicCode(IFormatter.RequiresDynamicCodeMessage)]
         [RequiresUnreferencedCode(IFormatter.RequiresUnreferencedCodeMessage)]
         public object Deserialize(Stream serializationStream)
             => throw new PlatformNotSupportedException(SR.BinaryFormatter_SerializationNotSupportedOnThisPlatform);
index 4411b3b..1ebff5d 100644 (file)
@@ -12,6 +12,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
     internal sealed class ObjectReader
     {
         private const string ObjectReaderUnreferencedCodeMessage = "ObjectReader requires unreferenced code";
+        private const string ObjectReaderDynamicCodeMessage = "ObjectReader requires dynamic code";
 
         // System.Serializer information
         internal Stream _stream;
@@ -74,6 +75,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             _formatterEnums = formatterEnums;
         }
 
+        [RequiresDynamicCode(ObjectReaderUnreferencedCodeMessage)]
         [RequiresUnreferencedCode("Types might be removed")]
         internal object Deserialize(BinaryParser serParser)
         {
@@ -170,6 +172,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             return ReadObjectInfo.Create(objectType, memberNames, memberTypes, _surrogates, _context, _objectManager, _serObjectInfoInit, _formatterConverter, _isSimpleAssembly);
         }
 
+        [RequiresDynamicCode(ObjectReaderDynamicCodeMessage)]
         [RequiresUnreferencedCode(ObjectReaderUnreferencedCodeMessage)]
         internal void Parse(ParseRecord pr)
         {
@@ -217,6 +220,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
         private void ParseSerializedStreamHeaderEnd(ParseRecord pr) => _stack!.Pop();
 
         // New object encountered in stream
+        [RequiresDynamicCode(ObjectReaderDynamicCodeMessage)]
         [RequiresUnreferencedCode(ObjectReaderUnreferencedCodeMessage)]
         private void ParseObject(ParseRecord pr)
         {
@@ -357,6 +361,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
         }
 
         // Array object encountered in stream
+        [RequiresDynamicCode(ObjectReaderDynamicCodeMessage)]
         [RequiresUnreferencedCode(ObjectReaderUnreferencedCodeMessage)]
         private void ParseArray(ParseRecord pr)
         {
@@ -523,6 +528,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
 
 
         // Array object item encountered in stream
+        [RequiresDynamicCode(ObjectReaderDynamicCodeMessage)]
         [RequiresUnreferencedCode(ObjectReaderUnreferencedCodeMessage)]
         private void ParseArrayMember(ParseRecord pr)
         {
@@ -697,6 +703,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             objectPr._memberIndex++;
         }
 
+        [RequiresDynamicCode(ObjectReaderDynamicCodeMessage)]
         [RequiresUnreferencedCode(ObjectReaderUnreferencedCodeMessage)]
         private void ParseArrayMemberEnd(ParseRecord pr)
         {
@@ -708,6 +715,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
         }
 
         // Object member encountered in stream
+        [RequiresDynamicCode(ObjectReaderDynamicCodeMessage)]
         [RequiresUnreferencedCode(ObjectReaderUnreferencedCodeMessage)]
         private void ParseMember(ParseRecord pr)
         {
@@ -821,6 +829,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
         }
 
         // Object member end encountered in stream
+        [RequiresDynamicCode(ObjectReaderDynamicCodeMessage)]
         [RequiresUnreferencedCode(ObjectReaderUnreferencedCodeMessage)]
         private void ParseMemberEnd(ParseRecord pr)
         {
index b648c85..1f9f869 100644 (file)
@@ -13,6 +13,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
     internal sealed class BinaryParser
     {
         private const string BinaryParserUnreferencedCodeMessage = "ObjectReader requires unreferenced code";
+        private const string BinaryParserDynamicCodeMessage = "ObjectReader requires dynamic code";
 
         private const int ChunkSize = 4096;
         private static readonly Encoding s_encoding = new UTF8Encoding(false, true);
@@ -69,6 +70,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
         // Reads each record from the input stream. If the record is a primitive type (A number)
         //  then it doesn't have a BinaryHeaderEnum byte. For this case the expected type
         //  has been previously set to Primitive
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode(BinaryParserUnreferencedCodeMessage)]
         internal void Run()
         {
@@ -307,6 +309,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             AssemIdToAssemblyTable[record._assemId] = new BinaryAssemblyInfo(record._assemblyString!);
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode(BinaryParserUnreferencedCodeMessage)]
         private void ReadObject()
         {
@@ -375,6 +378,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             _objectReader.Parse(pr);
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode(BinaryParserUnreferencedCodeMessage)]
         internal void ReadCrossAppDomainMap()
         {
@@ -398,6 +402,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             }
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode(BinaryParserUnreferencedCodeMessage)]
         internal void ReadObjectWithMap(BinaryHeaderEnum binaryHeaderEnum)
         {
@@ -413,6 +418,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             ReadObjectWithMap(_bowm);
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode("Types might be removed")]
         private void ReadObjectWithMap(BinaryObjectWithMap record)
         {
@@ -500,6 +506,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             _objectReader.Parse(pr);
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode("Types might be removed")]
         internal void ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
         {
@@ -515,6 +522,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             ReadObjectWithMapTyped(_bowmt);
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode("Types might be removed")]
         private void ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
         {
@@ -596,6 +604,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             _objectReader.Parse(pr);
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode(BinaryParserUnreferencedCodeMessage)]
         private void ReadObjectString(BinaryHeaderEnum binaryHeaderEnum)
         {
@@ -667,6 +676,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             _objectReader.Parse(PRs);
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode(BinaryParserUnreferencedCodeMessage)]
         private void ReadMemberPrimitiveTyped()
         {
@@ -712,6 +722,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             _objectReader.Parse(PRs);
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode(BinaryParserUnreferencedCodeMessage)]
         private void ReadArray(BinaryHeaderEnum binaryHeaderEnum)
         {
@@ -895,6 +906,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             }
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode(BinaryParserUnreferencedCodeMessage)]
         private void ReadMemberPrimitiveUnTyped()
         {
@@ -925,6 +937,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             _objectReader.Parse(PRs);
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode(BinaryParserUnreferencedCodeMessage)]
         private void ReadMemberReference()
         {
@@ -953,6 +966,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             _objectReader.Parse(PRs);
         }
 
+        [RequiresDynamicCode(BinaryParserDynamicCodeMessage)]
         [RequiresUnreferencedCode(BinaryParserUnreferencedCodeMessage)]
         private void ReadObjectNull(BinaryHeaderEnum binaryHeaderEnum)
         {
index c1640a5..0928b39 100644 (file)
@@ -8,9 +8,11 @@ namespace System.Runtime.Serialization
 {
     public interface IFormatter
     {
-        internal const string RequiresUnreferencedCodeMessage = "BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.";
+        internal const string RequiresDynamicCodeMessage = "BinaryFormatter serialization uses dynamic code generation, the type of objects being processed cannot be statically discovered.";
+        internal const string RequiresUnreferencedCodeMessage = "BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.";
 
         [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
+        [RequiresDynamicCode(RequiresDynamicCodeMessage)]
         [RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)]
         object Deserialize(Stream serializationStream);
         [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
index 523daff..53d1ab8 100644 (file)
@@ -14,7 +14,7 @@ namespace System.Runtime.Serialization
         private const int ArrayMask = MaxArraySize - 1;
         private const int MaxReferenceDepth = 100;
 
-        private const string ObjectManagerUnreferencedCodeMessage = "ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.";
+        private const string ObjectManagerUnreferencedCodeMessage = "ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.";
 
         private static readonly FieldInfo s_nullableValueField = typeof(Nullable<>).GetField("value", BindingFlags.NonPublic | BindingFlags.Instance)!;
 
index 69ae993..9c0b129 100644 (file)
@@ -8,7 +8,7 @@ namespace System.Runtime.Serialization
 {
     public sealed class SerializationObjectManager
     {
-        private const string SerializationObjectManagerUnreferencedCodeMessage = "SerializationObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.";
+        private const string SerializationObjectManagerUnreferencedCodeMessage = "SerializationObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.";
 
         private readonly Dictionary<object, object> _objectSeenTable; // Table to keep track of objects [OnSerializing] has been called on
         private readonly StreamingContext _context;
index 1361a3c..b01dfa1 100644 (file)
@@ -2,6 +2,19 @@ Compat issues with assembly mscorlib:
 CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.IO.FileStream.Lock(System.Int64, System.Int64)' changed from '[UnsupportedOSPlatformAttribute("ios")]' in the contract to '[UnsupportedOSPlatformAttribute("freebsd")]' in the implementation.
 CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.IO.FileStream.Unlock(System.Int64, System.Int64)' changed from '[UnsupportedOSPlatformAttribute("ios")]' in the contract to '[UnsupportedOSPlatformAttribute("freebsd")]' in the implementation.
 CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.RequiresPreviewFeaturesAttribute' exists on 'System.String System.Runtime.CompilerServices.RuntimeFeature.VirtualStaticsInInterfaces' in the contract but not the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatter.Deserialize(System.IO.Stream)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatter.Serialize(System.IO.Stream, System.Object)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.IFormatter.Deserialize(System.IO.Stream)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.IFormatter.Serialize(System.IO.Stream, System.Object)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.DoFixups()' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RaiseOnDeserializingEvent(System.Object)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64, System.Runtime.Serialization.SerializationInfo)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64, System.Runtime.Serialization.SerializationInfo, System.Int64, System.Reflection.MemberInfo)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64, System.Runtime.Serialization.SerializationInfo, System.Int64, System.Reflection.MemberInfo, System.Int32[])' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.SerializationObjectManager.RegisterObject(System.Object)' changed from '[RequiresUnreferencedCodeAttribute("SerializationObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("SerializationObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(System.IO.Stream)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream, System.Object)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
 CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.Aes' in the contract but not the implementation.
 CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeDeformatter' in the contract but not the implementation.
 CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeFormatter' in the contract but not the implementation.
@@ -59,6 +72,19 @@ CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAtt
 CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector<T>.TryCopyTo(System.Span<System.Byte>)' in the contract but not the implementation.
 CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector<T>.TryCopyTo(System.Span<T>)' in the contract but not the implementation.
 CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.RequiresPreviewFeaturesAttribute' exists on 'System.String System.Runtime.CompilerServices.RuntimeFeature.VirtualStaticsInInterfaces' in the contract but not the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatter.Deserialize(System.IO.Stream)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatter.Serialize(System.IO.Stream, System.Object)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.IFormatter.Deserialize(System.IO.Stream)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.IFormatter.Serialize(System.IO.Stream, System.Object)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.DoFixups()' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RaiseOnDeserializingEvent(System.Object)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64, System.Runtime.Serialization.SerializationInfo)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64, System.Runtime.Serialization.SerializationInfo, System.Int64, System.Reflection.MemberInfo)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64, System.Runtime.Serialization.SerializationInfo, System.Int64, System.Reflection.MemberInfo, System.Int32[])' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.SerializationObjectManager.RegisterObject(System.Object)' changed from '[RequiresUnreferencedCodeAttribute("SerializationObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("SerializationObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(System.IO.Stream)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream, System.Object)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
 CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.Aes' in the contract but not the implementation.
 CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeDeformatter' in the contract but not the implementation.
 CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeFormatter' in the contract but not the implementation.
@@ -150,6 +176,20 @@ Compat issues with assembly System.Runtime.Intrinsics:
 MembersMustExist : Member 'public System.Runtime.Intrinsics.Vector128<U> System.Runtime.Intrinsics.Vector128.As<T, U>(System.Runtime.Intrinsics.Vector128<T>)' does not exist in the implementation but it does exist in the contract.
 MembersMustExist : Member 'public System.Runtime.Intrinsics.Vector256<U> System.Runtime.Intrinsics.Vector256.As<T, U>(System.Runtime.Intrinsics.Vector256<T>)' does not exist in the implementation but it does exist in the contract.
 MembersMustExist : Member 'public System.Runtime.Intrinsics.Vector64<U> System.Runtime.Intrinsics.Vector64.As<T, U>(System.Runtime.Intrinsics.Vector64<T>)' does not exist in the implementation but it does exist in the contract.
+Compat issues with assembly System.Runtime.Serialization.Formatters:
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatter.Deserialize(System.IO.Stream)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatter.Serialize(System.IO.Stream, System.Object)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.IFormatter.Deserialize(System.IO.Stream)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.IFormatter.Serialize(System.IO.Stream, System.Object)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.DoFixups()' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RaiseOnDeserializingEvent(System.Object)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64, System.Runtime.Serialization.SerializationInfo)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64, System.Runtime.Serialization.SerializationInfo, System.Int64, System.Reflection.MemberInfo)' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.ObjectManager.RegisterObject(System.Object, System.Int64, System.Runtime.Serialization.SerializationInfo, System.Int64, System.Reflection.MemberInfo, System.Int32[])' changed from '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.SerializationObjectManager.RegisterObject(System.Object)' changed from '[RequiresUnreferencedCodeAttribute("SerializationObjectManager is not trim compatible because the Type of objects being managed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("SerializationObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(System.IO.Stream)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
+CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute' on 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream, System.Object)' changed from '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]' in the contract to '[RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]' in the implementation.
 Compat issues with assembly System.Security.Cryptography.Algorithms:
 CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.Aes' in the contract but not the implementation.
 CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeDeformatter' in the contract but not the implementation.
@@ -197,4 +237,4 @@ Compat issues with assembly System.Security.Cryptography.X509Certificates:
 CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.X509Certificates.PublicKey.GetDSAPublicKey()' changed from '[UnsupportedOSPlatformAttribute("ios")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation.
 Compat issues with assembly System.Text.Json:
 CannotMakeTypeAbstract : Type 'System.Text.Json.Serialization.Metadata.JsonTypeInfo' is abstract in the implementation but is not abstract in the contract.
-Total Issues: 184
+Total Issues: 223