SerializationInfo Constructors

Definition

Initializes a new instance of the SerializationInfo class.

Overloads

SerializationInfo(Type, IFormatterConverter)
Obsolete.

Creates a new instance of the SerializationInfo class.

SerializationInfo(Type, IFormatterConverter, Boolean)
Obsolete.

Initializes a new instance of the SerializationInfo class.

SerializationInfo(Type, IFormatterConverter)

Source:
SerializationInfo.cs
Source:
SerializationInfo.cs
Source:
SerializationInfo.cs

Caution

Formatter-based serialization is obsolete and should not be used.

Important

This API is not CLS-compliant.

Creates a new instance of the SerializationInfo class.

[System.CLSCompliant(false)]
public SerializationInfo (Type type, System.Runtime.Serialization.IFormatterConverter converter);
[System.CLSCompliant(false)]
[System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public SerializationInfo (Type type, System.Runtime.Serialization.IFormatterConverter converter);

Parameters

type
Type

The Type of the object to serialize.

converter
IFormatterConverter

The IFormatterConverter used during deserialization.

Attributes

Exceptions

type or converter is null.

Remarks

The IFormatterConverter passed as the converter parameter converts data from its internal representation to the form the user requested. The internal representation of the data within the SerializationInfo depends on the formatter that created it.

Applies to

.NET 9 and other versions
Product Versions (Obsolete)
.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 (package-provided), 8, 9)
.NET Framework 1.1, 2.0, 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

SerializationInfo(Type, IFormatterConverter, Boolean)

Source:
SerializationInfo.cs
Source:
SerializationInfo.cs
Source:
SerializationInfo.cs

Caution

Formatter-based serialization is obsolete and should not be used.

Important

This API is not CLS-compliant.

Initializes a new instance of the SerializationInfo class.

[System.CLSCompliant(false)]
public SerializationInfo (Type type, System.Runtime.Serialization.IFormatterConverter converter, bool requireSameTokenInPartialTrust);
[System.CLSCompliant(false)]
[System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public SerializationInfo (Type type, System.Runtime.Serialization.IFormatterConverter converter, bool requireSameTokenInPartialTrust);

Parameters

type
Type

The Type of the object to serialize.

converter
IFormatterConverter

The IFormatterConverter used during deserialization.

requireSameTokenInPartialTrust
Boolean

Indicates whether the object requires same token in partial trust.

Attributes

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 (package-provided), 8, 9)
.NET Framework 2.0, 3.0, 3.5, 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