Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 4f32b8d

Browse files
committed
Purpose: Fixing Bug 1189542 : Enable DCS/DCJS Serialization for some common types
Cause: Certain common types used to rely on [Serializable] to be serializable, which no longer exists in N. Solution: Add these types to known serializable types list. [tfs-changeset: 1494532]
1 parent 13b98aa commit 4f32b8d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,15 @@ static internal bool IsNonAttributedTypeValidForSerialization(Type type)
437437
}
438438

439439
private static string[] s_knownSerializableTypeNames = new string[] {
440+
"System.Collections.Queue",
441+
"System.Collections.Stack",
442+
"System.Globalization.CultureInfo",
443+
"System.Version",
444+
"System.Collections.Generic.KeyValuePair`2",
445+
"System.Collections.Generic.Queue`1",
446+
"System.Collections.Generic.Stack`1",
447+
"System.Collections.ObjectModel.ReadOnlyCollection`1",
448+
"System.Collections.ObjectModel.ReadOnlyDictionary`2",
440449
"System.Tuple`1",
441450
"System.Tuple`2",
442451
"System.Tuple`3",
@@ -445,9 +454,6 @@ static internal bool IsNonAttributedTypeValidForSerialization(Type type)
445454
"System.Tuple`6",
446455
"System.Tuple`7",
447456
"System.Tuple`8",
448-
"System.Collections.Generic.Queue`1",
449-
"System.Version",
450-
"System.Collections.ObjectModel.ReadOnlyCollection`1"
451457
};
452458

453459
internal static bool IsKnownSerializableType(Type type)

0 commit comments

Comments
 (0)