Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Latest commit

 

History

History
57 lines (45 loc) · 2.72 KB

081 XmlWriter throws on invalid surrogate pairs.md

File metadata and controls

57 lines (45 loc) · 2.72 KB

81: XmlWriter throws on invalid surrogate pairs

Scope

Edge

Version Introduced

4.6

Source Analyzer Status

Planned

Change Description

For apps that target the .NET Framework 4.5.2 or previous versions, writing an invalid surrogate pair using exception fallback handling does not always throw an exception. For apps that target the .NET Framework 4.6, attempting to write an invalid surrogate pair throws an ArgumentException.

  • Quirked
  • Build-time break

Recommended Action

If necessary, this break can be avoided by targeting the .NET Framework 4.5.2 or earlier. Alternatively, invalid surrogate pairs can be pre-processed into valid xml prior to writing them.

Affected APIs

  • M:System.Xml.XmlWriter.WriteAttributeString(System.String,System.String)
  • M:System.Xml.XmlWriter.WriteAttributeString(System.String,System.String,System.String)
  • M:System.Xml.XmlWriter.WriteAttributeString(System.String,System.String,System.String,System.String)
  • M:System.Xml.XmlWriter.WriteAttributeStringAsync(System.String,System.String,System.String,System.String)
  • M:System.Xml.XmlWriter.WriteCData(System.String)
  • M:System.Xml.XmlWriter.WriteCDataAsync(System.String)
  • M:System.Xml.XmlWriter.WriteChars(System.Char[],System.Int32,System.Int32)
  • M:System.Xml.XmlWriter.WriteCharsAsync(System.Char[],System.Int32,System.Int32)
  • M:System.Xml.XmlWriter.WriteComment(System.String)
  • M:System.Xml.XmlWriter.WriteCommentAsync(System.String)
  • M:System.Xml.XmlWriter.WriteEntityRef(System.String)
  • M:System.Xml.XmlWriter.WriteEntityRefAsync(System.String)
  • M:System.Xml.XmlWriter.WriteRaw(System.Char[],System.Int32,System.Int32)
  • M:System.Xml.XmlWriter.WriteProcessingInstruction(System.String,System.String)
  • M:System.Xml.XmlWriter.WriteProcessingInstructionAsync(System.String,System.String)
  • M:System.Xml.XmlWriter.WriteRaw(System.String)
  • M:System.Xml.XmlWriter.WriteRawAsync(System.Char[],System.Int32,System.Int32)
  • M:System.Xml.XmlWriter.WriteRawAsync(System.String)
  • M:System.Xml.XmlWriter.WriteString(System.String)
  • M:System.Xml.XmlWriter.WriteStringAsync(System.String)
  • M:System.Xml.XmlWriter.WriteSurrogateCharEntity(System.Char,System.Char)
  • M:System.Xml.XmlWriter.WriteSurrogateCharEntityAsync(System.Char,System.Char)
  • M:System.Xml.XmlWriter.WriteValue(System.String)

Category

XML, XSLT

More information