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

Commit 5bad454

Browse files
committed
Purpose: Bug 1180013 : [DataContractJsonSerializer]: Unable to De/Serialize 'ReadOnlyCollection<T>' in a Windows 10 Universal app
Cause: ReadOnlyCollection<T> used to be serializable throught [Serializable] attribute, which is no longer available in N and K. Solution: Add ReadOnlyCollection<T> to DCS_KnownSerializableGenericTypes list so that DataContract can be created for ReadOnlyCollection<T>. Note: This is for K only, the fix for N has been checked in. Unit tests have been checked in along with N fix. [tfs-changeset: 1482134]
1 parent 13b75f0 commit 5bad454

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ static internal bool IsNonAttributedTypeValidForSerialization(Type type)
408408
"System.Tuple`7",
409409
"System.Tuple`8",
410410
"System.Collections.Generic.Queue`1",
411-
"System.Version"
411+
"System.Version",
412+
"System.Collections.ObjectModel.ReadOnlyCollection`1"
412413
};
413414

414415
internal static bool IsKnownSerializableType(Type type)

0 commit comments

Comments
 (0)