Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/orleans/host/configuration-guide/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ Alternatively, the fallback serialization provider can be specified in XML confi

The <xref:Orleans.Serialization.BinaryFormatterSerializer> is the default fallback serializer.

[!INCLUDE [binary-serialization-warning](../../../../binary-serialization-warning.md)]

## Exception serialization

Exceptions are serialized using the [fallback serializer](serialization.md#fallback-serialization). Using the default configuration, `BinaryFormatter` is the fallback serializer and so the [ISerializable pattern](/previous-versions/dotnet/fundamentals/serialization/binary/custom-serialization) must be followed in order to ensure correct serialization of all properties in an exception type.
Expand Down
4 changes: 4 additions & 0 deletions docs/standard/design-guidelines/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Serialization is the process of converting an object into a format that can be r

❌ AVOID supporting Runtime Serialization or XML Serialization just for general persistence reasons. Prefer Data Contract Serialization instead.

[!INCLUDE [binary-serialization-warning](../../../binary-serialization-warning.md)]

[!INCLUDE [netdatacontractserializer-warning](../../../netdatacontractserializer-warning.md)]

## Supporting Data Contract Serialization

Types can support Data Contract Serialization by applying the <xref:System.Runtime.Serialization.DataContractAttribute> to the type and the <xref:System.Runtime.Serialization.DataMemberAttribute> to the members (fields and properties) of the type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ While `DataContractSerializer` carries those functional benefits when migrating

[Migrate to DataContractSerializer (XML)](./migrate-to-datacontractserializer.md).

> [!NOTE]
> Do not confuse <xref:System.Runtime.Serialization.DataContractSerializer> with <xref:System.Runtime.Serialization.NetDataContractSerializer>. <xref:System.Runtime.Serialization.NetDataContractSerializer> is also identified as a [dangerous serializer](../binaryformatter-security-guide.md#dangerous-alternatives).
[!INCLUDE [netdatacontractserializer-warning](../../../../netdatacontractserializer-warning.md)]

## Binary using MessagePack

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ The <xref:System.Runtime.Serialization.Formatters.Soap.SoapFormatter?displayProp

#### Suggestion

<xref:System.Runtime.Serialization.Formatters.Soap.SoapFormatter?displayProperty=fullName> serialization should be replaced with <xref:System.Runtime.Serialization.Formatters.Binary.BinaryFormatter?displayProperty=fullName> serialization or <xref:System.Runtime.Serialization.NetDataContractSerializer?displayProperty=fullName> to be resilient to .NET Framework changes.
<xref:System.Runtime.Serialization.Formatters.Soap.SoapFormatter?displayProperty=fullName> serialization should be replaced with a serializer that is resilient to .NET Framework changes. Examples include [System.Text.Json](/dotnet/standard/serialization/system-text-json/overview) and <xref:System.Runtime.Serialization.DataContractSerializer?displayProperty=fullName>.

[!INCLUDE [binary-serialization-warning](../../../binary-serialization-warning.md)]

[!INCLUDE [netdatacontractserializer-warning](../../../netdatacontractserializer-warning.md)]

| Name | Value |
| :------ | :------ |
| Scope | Minor |
Expand Down
2 changes: 2 additions & 0 deletions includes/netdatacontractserializer-warning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> [!WARNING]
> Do not confuse <xref:System.Runtime.Serialization.DataContractSerializer> with <xref:System.Runtime.Serialization.NetDataContractSerializer>. <xref:System.Runtime.Serialization.NetDataContractSerializer> is identified as a [dangerous serializer](/dotnet/standard/serialization/binaryformatter-security-guide.md#dangerous-alternatives).
Loading