Skip to main content
Source: AL0007ToAL0009IXmlSerializableAnalyzer.cs

Description

Implement IXmlSerializable.GetSchema explicitly to avoid exposing it as part of the public API.

Bad Code

public XmlSchema? GetSchema() => null;

Good Code

XmlSchema? IXmlSerializable.GetSchema() => null;

Properties

  • Category: Usage
  • Severity: Error
  • Enabled by default: True
  • Code fix available: False

Configuration

dotnet_diagnostic.AL0007.severity = warning