InvalidDataContractException Constructors

Definition

Initializes a new instance of the InvalidDataContractException class.

Overloads

InvalidDataContractException()

Initializes a new instance of the InvalidDataContractException class.

InvalidDataContractException(String)

Initializes a new instance of the InvalidDataContractException class with the specified error message.

InvalidDataContractException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the InvalidDataContractException class with the specified SerializationInfo and StreamingContext.

InvalidDataContractException(String, Exception)

Initializes a new instance of the InvalidDataContractException class with the specified error message and inner exception.

InvalidDataContractException()

Source:
InvalidDataContractException.cs
Source:
InvalidDataContractException.cs
Source:
InvalidDataContractException.cs

Initializes a new instance of the InvalidDataContractException class.

public InvalidDataContractException ();

Applies to

.NET 9 and other versions
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
.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

InvalidDataContractException(String)

Source:
InvalidDataContractException.cs
Source:
InvalidDataContractException.cs
Source:
InvalidDataContractException.cs

Initializes a new instance of the InvalidDataContractException class with the specified error message.

public InvalidDataContractException (string message);
public InvalidDataContractException (string? message);

Parameters

message
String

A description of the error.

Applies to

.NET 9 and other versions
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
.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

InvalidDataContractException(SerializationInfo, StreamingContext)

Source:
InvalidDataContractException.cs
Source:
InvalidDataContractException.cs
Source:
InvalidDataContractException.cs

Caution

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initializes a new instance of the InvalidDataContractException class with the specified SerializationInfo and StreamingContext.

protected InvalidDataContractException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected InvalidDataContractException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);

Parameters

info
SerializationInfo

A SerializationInfo that contains data needed to serialize and deserialize an object.

context
StreamingContext

A StreamingContext that specifies user context during serialization and deserialization.

Attributes

Remarks

This constructor is used in deserialization by one of the formatters in the System.Runtime.Serialization namespace.

Applies to

.NET 9 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9)
.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

InvalidDataContractException(String, Exception)

Source:
InvalidDataContractException.cs
Source:
InvalidDataContractException.cs
Source:
InvalidDataContractException.cs

Initializes a new instance of the InvalidDataContractException class with the specified error message and inner exception.

public InvalidDataContractException (string message, Exception innerException);
public InvalidDataContractException (string? message, Exception? innerException);

Parameters

message
String

A description of the error.

innerException
Exception

The original Exception.

Applies to

.NET 9 and other versions
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
.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