Converts the specified JavaScript Object Notation (JSON) string to an object graph.
Syntax
CSharp
VisualBasic
Public Function DeserializeObject ( _
input As String _
) As Object
ManagedCPlusPlus
JSharp
Parameters
- input (String)
The JSON string to be deserialized.
Return Value
Return Value
The deserialized object.
Remarks
This deserialization variation does not attempt to cast the root of the object graph to a specific type, as with the Deserialize<(Of T>)(String) method.
Exceptions
| Exception | Condition |
|---|
| ArgumentNullException | input is null. |
| ArgumentException | The input length exceeds MaxJsonLength. -or- The recursion limit defined by RecursionLimit was exceeded. -or- input contains an unexpected character sequence. -or- input is a dictionary type and a non-string key value is encountered. -or- input includes member definitions that are not available on the target type. |
| InvalidOperationException | input contains a “__type” tag indicating a custom type, but the type resolver that is currently associated with the serializer cannot find a corresponding managed type. -or- input contains a “__type” tag indicating a custom type, but the result of deserializing the corresponding JSON string cannot be assigned to the expected target type. -or- input contains a “__type” tag indicating either Object or a non-instantiable type (for example, abstract types and interfaces). -or- An attempt is made to convert a JSON array to an array-like managed type which is not supported for use as a JSON deserialization target. -or- It is not possible to convert input to the target type. |
Assembly: System.Web.Extensions (Module: System.Web.Extensions)