diff --git a/src/libraries/System.Resources.Extensions/tests/BinaryFormatTests/FormattedObject/BasicObjectTests.cs b/src/libraries/System.Resources.Extensions/tests/BinaryFormatTests/FormattedObject/BasicObjectTests.cs index b316a3e32b5020..fd5fdc9b8c01aa 100644 --- a/src/libraries/System.Resources.Extensions/tests/BinaryFormatTests/FormattedObject/BasicObjectTests.cs +++ b/src/libraries/System.Resources.Extensions/tests/BinaryFormatTests/FormattedObject/BasicObjectTests.cs @@ -14,6 +14,14 @@ public class BasicObjectTests : Common.BasicObjectTests))) + { + // We can root the provided value, but we can't root the deserialized value: + // GC can free the target of WeakReference after it gets deserialized, + // but before it gets returned from BinaryFormatter.Deserialize. + return; + } + // We need to round trip through the BinaryFormatter as a few objects in tests remove // serialized data on deserialization. BinaryFormatter formatter = new();