Type Reason InvalidOperationException The XmlWriter.WriteState is WriteState.Closed.
This is a more advanced version of XmlWriter.WriteAttributeString(string, string, string) that allows you to write an attribute value using multiple write methods, such as XmlWriter.WriteString(string), XmlWriter.WriteQualifiedName(string, string), and so on.
For the asynchronous version of this method, see XmlWriter.WriteStartAttributeAsync(string, string).