Skip to main content
Source: AL0007ToAL0009IXmlSerializableAnalyzer.cs

Description

GetSchema should return null according to IXmlSerializable guidance and should not be abstract.

Bad Code

XmlSchema? IXmlSerializable.GetSchema() => new XmlSchema();

Good Code

XmlSchema? IXmlSerializable.GetSchema() => null;

Properties

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

Configuration

dotnet_diagnostic.AL0008.severity = warning