Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Text.​Json.​JsonException

Assembly: System.Text.Json

Inheritance: object → Exception → JsonException

Implemented Interfaces

Defines a custom exception object that is thrown when invalid JSON text is encountered, the defined maximum depth is passed, or the JSON text is not compatible with the type of a property on an object.

Properties

public long?
BytePositionInLine
Gets the zero-based number of bytes read within the current line before the exception.
public long?
LineNumber
Gets the zero-based number of lines read before the exception.
public string
Message
Gets a message that describes the current exception.
public string
Path
Gets The path within the JSON where the exception was encountered.
public string
HelpLink
public int
HResult
public Exception
InnerException
public string
Source
public string
StackTrace
TargetSite

Methods

public void
GetObjectData​(Runtime.​Serialization.​SerializationInfo info, Runtime.​Serialization.​StreamingContext context)
Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception.
info The serialized object data about the exception being thrown.
context An object that contains contextual information about the source or destination.
public Exception
GetBaseException​()
Inherited from Exception
public Type
GetType​()
Inherited from Exception
public string
ToString​()
Inherited from Exception
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object