Skip to content

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 23 Oct 04:57
· 15 commits to main since this release

2.0.0 (2026-10-23)

⚠ BREAKING CHANGES

  • Abstractions: - All references to (Type, string) tuples have been changed to PolymorphicMapping for DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor), improving trim/AOT analysis. Previously, code analysis could fail if the warning was traced to XmlSerializationOptions.cs via ProjectReference.
  • Method definitions with a Type-type parameter will now warn with IL2077 if the argument is not annotated as public-parameterless constructor.
  • implicit conversions between (Type,string) and PolymorphicMapping have been removed because the public-parameterless-constructor annotations are lost in conversion.
  • record-class XmlSourceGenerator.Abstractions.XmlPropertySettings.PolymorphicMapping has been moved to XmlSourceGenerator.Abstractions.PolymorphicMapping
  • Overload WriteDataToStreamAsync<T>(Stream stream, IEnumerable<T> items, XmlSerializationOptions? options = null, string rootName = "ArrayOfItems", string? itemName = null) has been removed. Calls to WriteDataToStreamAsync<T>(Stream stream, T item, XmlSerializationOptions? options = null, string? rootName = null, string? itemName = null) where T : IEnumerable will throw an ArgumentException telling you to use WriteEnumerableDataToStreamAsync.

Features

  • Abstractions: add XmlPropertySettings.PolymorphicMapping to replace (Type, string) tuple + constraints on Type (cebc7e5)
  • add GeneratorTypeModel.IsNullableAnnotated to track symbols whose types have ? annotation (1144246)
  • add WriteEnumerableDataToStreamAsync (98e68c3)

Bug Fixes

  • Abstractions: resolve some IL2077 'Type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' warnings; annotate generated Type field as PublicParameterlessConstructor; annotated Type parameters (b559d3d)
  • add new modifier to generated IXmlStreamable members when a base class implements it manually or via XmlAutoGenerate (617d025), closes upstream#10
  • add diagnostics' helpLinkUris (aec2943)
  • allow implicit list serialization; do not enable IsFlattened on Collection-like objects (675b3a3)
  • annotate Type-type parameters of WriteEnumerableDataToStreamAsync and GetRootName with PublicParameterlessConstructor (6b242ea)
  • append EOF newline to generated output (7f2047c)
  • enable Release tracking analyzer (f3dca9b)
  • explicitly define PolymorphicMapping's properties; add PublicParameterlessConstructor to the Type property (a97ef26)
  • forgive some null false-positives; convert null from CreateInstance to Nullable<T>? (c737191)
  • Generators: remove redundant space in ReadFromXml output (c1173a2)
  • ignore XAttribute-type symbols in addition to XElement-type symbols (a4b1560), closes upstream#11
  • prepend source generator header; conditionally enable/restore #nullable, (2209e75)
  • resolve CS1587 warnings caused by 2209e75 (6df696b)
  • resolve warning RS1032; add trailing periods to diagnostic messages (2408a32)
  • XmlSourceGenerator: prevent CS0457 when casting XElement to byte (00fe40c)