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.
Reads an XML document or document stream and returns the deserialized object.
ReadObject(Stream) |
Reads the XML stream or document with a Stream and returns the deserialized object. |
ReadObject(XmlDictionaryReader) |
Reads the XML document or stream with an XmlDictionaryReader and returns the deserialized object. |
ReadObject(XmlReader) |
Reads the XML document or stream with an XmlReader and returns the deserialized object. |
ReadObject(XmlDictionaryReader, Boolean) |
Reads the XML stream or document with an XmlDictionaryReader and returns the deserialized object; it also enables you to specify whether the serializer can read the data before attempting to read it. |
ReadObject(XmlReader, Boolean) |
Reads the XML document or stream with an XmlReader and returns the deserialized object; it also enables you to specify whether the serializer can read the data before attempting to read it. |
Reads the XML stream or document with a Stream and returns the deserialized object.
public:
virtual System::Object ^ ReadObject(System::IO::Stream ^ stream);
public virtual object ReadObject(System.IO.Stream stream);
public virtual object? ReadObject(System.IO.Stream stream);
abstract member ReadObject : System.IO.Stream -> obj
override this.ReadObject : System.IO.Stream -> obj
Public Overridable Function ReadObject (stream As Stream) As Object
The deserialized object.
This method is a virtual method, and has a default implementation that creates a dictionary reader to read the underlying stream and deserialize it. The default implementation assumes the stream is text or XML.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
Reads the XML document or stream with an XmlDictionaryReader and returns the deserialized object.
public:
virtual System::Object ^ ReadObject(System::Xml::XmlDictionaryReader ^ reader);
public virtual object ReadObject(System.Xml.XmlDictionaryReader reader);
public virtual object? ReadObject(System.Xml.XmlDictionaryReader reader);
abstract member ReadObject : System.Xml.XmlDictionaryReader -> obj
override this.ReadObject : System.Xml.XmlDictionaryReader -> obj
Public Overridable Function ReadObject (reader As XmlDictionaryReader) As Object
An XmlDictionaryReader used to read the XML document.
The deserialized object.
This method is a virtual method, and has a default implementation that creates a dictionary reader to read the underlying stream and deserialize it. The default implementation assumes the stream is text or XML.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
Reads the XML document or stream with an XmlReader and returns the deserialized object.
public:
virtual System::Object ^ ReadObject(System::Xml::XmlReader ^ reader);
public virtual object ReadObject(System.Xml.XmlReader reader);
public virtual object? ReadObject(System.Xml.XmlReader reader);
abstract member ReadObject : System.Xml.XmlReader -> obj
override this.ReadObject : System.Xml.XmlReader -> obj
Public Overridable Function ReadObject (reader As XmlReader) As Object
The deserialized object.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
Reads the XML stream or document with an XmlDictionaryReader and returns the deserialized object; it also enables you to specify whether the serializer can read the data before attempting to read it.
public:
abstract System::Object ^ ReadObject(System::Xml::XmlDictionaryReader ^ reader, bool verifyObjectName);
public abstract object ReadObject(System.Xml.XmlDictionaryReader reader, bool verifyObjectName);
public abstract object? ReadObject(System.Xml.XmlDictionaryReader reader, bool verifyObjectName);
abstract member ReadObject : System.Xml.XmlDictionaryReader * bool -> obj
Public MustOverride Function ReadObject (reader As XmlDictionaryReader, verifyObjectName As Boolean) As Object
An XmlDictionaryReader used to read the XML document.
true
to check whether the enclosing XML element name and namespace correspond to the root name and root namespace; otherwise, false
to skip the verification.
The deserialized object.
The verifyObjectName
parameter uses the same code as the IsStartObject method to determine whether the element is the start of the object.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
Reads the XML document or stream with an XmlReader and returns the deserialized object; it also enables you to specify whether the serializer can read the data before attempting to read it.
public:
virtual System::Object ^ ReadObject(System::Xml::XmlReader ^ reader, bool verifyObjectName);
public virtual object ReadObject(System.Xml.XmlReader reader, bool verifyObjectName);
public virtual object? ReadObject(System.Xml.XmlReader reader, bool verifyObjectName);
abstract member ReadObject : System.Xml.XmlReader * bool -> obj
override this.ReadObject : System.Xml.XmlReader * bool -> obj
Public Overridable Function ReadObject (reader As XmlReader, verifyObjectName As Boolean) As Object
true
to check whether the enclosing XML element name and namespace correspond to the root name and root namespace; false
to skip the verification.
The deserialized object.
The verifyObjectName
parameter uses the same code as the IsStartObject method to determine whether the element is the start of the object.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
.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