Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Writes all the object data (starting XML element, content, and closing element) to an XML document or stream.
WriteObject(Stream, Object) |
Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified Stream. |
WriteObject(XmlDictionaryWriter, Object) |
Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified XmlDictionaryWriter. |
WriteObject(XmlWriter, Object) |
Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified XmlWriter. |
Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified Stream.
public:
virtual void WriteObject(System::IO::Stream ^ stream, System::Object ^ graph);
public virtual void WriteObject(System.IO.Stream stream, object graph);
public virtual void WriteObject(System.IO.Stream stream, object? graph);
abstract member WriteObject : System.IO.Stream * obj -> unit
override this.WriteObject : System.IO.Stream * obj -> unit
Public Overridable Sub WriteObject (stream As Stream, graph As Object)
The object that contains the data to write to the stream.
the type being serialized does not conform to data contract rules. For example, the DataContractAttribute attribute has not been applied to the type.
there is a problem with the instance being serialized.
the maximum number of objects to serialize has been exceeded. Check the MaxItemsInObjectGraph property.
Product | Versions |
---|---|
Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified XmlDictionaryWriter.
public:
virtual void WriteObject(System::Xml::XmlDictionaryWriter ^ writer, System::Object ^ graph);
public virtual void WriteObject(System.Xml.XmlDictionaryWriter writer, object graph);
public virtual void WriteObject(System.Xml.XmlDictionaryWriter writer, object? graph);
abstract member WriteObject : System.Xml.XmlDictionaryWriter * obj -> unit
override this.WriteObject : System.Xml.XmlDictionaryWriter * obj -> unit
Public Overridable Sub WriteObject (writer As XmlDictionaryWriter, graph As Object)
An XmlDictionaryWriter used to write the content to the XML document or stream.
The object that contains the content to write.
the type being serialized does not conform to data contract rules. For example, the DataContractAttribute attribute has not been applied to the type.
there is a problem with the instance being serialized.
the maximum number of objects to serialize has been exceeded. Check the MaxItemsInObjectGraph property.
This is a virtual method and has a default implementation that calls the WriteStartObject, WriteObjectContent, and WriteEndObject methods. Because of this, this method is intended to be the most commonly used method on a serializer.
Product | Versions |
---|---|
Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified XmlWriter.
public:
virtual void WriteObject(System::Xml::XmlWriter ^ writer, System::Object ^ graph);
public virtual void WriteObject(System.Xml.XmlWriter writer, object graph);
public virtual void WriteObject(System.Xml.XmlWriter writer, object? graph);
abstract member WriteObject : System.Xml.XmlWriter * obj -> unit
override this.WriteObject : System.Xml.XmlWriter * obj -> unit
Public Overridable Sub WriteObject (writer As XmlWriter, graph As Object)
The object that contains the content to write.
the type being serialized does not conform to data contract rules. For example, the DataContractAttribute attribute has not been applied to the type.
there is a problem with the instance being serialized.
the maximum number of objects to serialize has been exceeded. Check the MaxItemsInObjectGraph property.
This is a virtual method, and has a default implementation that delegates writing to the XmlObjectSerializer.WriteObject(XmlDictionaryWriter, Object) overload.
Product | Versions |
---|---|
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in