From 46bf30eb1ef170092ea8ff8575e8f92ac898c6cc Mon Sep 17 00:00:00 2001 From: Levi Broderick Date: Fri, 15 Jul 2022 11:44:31 -0700 Subject: [PATCH] Differentiate BF disabled error messages (#72248) --- .../src/Resources/Strings.resx | 3 +++ .../Formatters/Binary/BinaryFormatter.PlatformNotSupported.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/Resources/Strings.resx b/src/libraries/System.Runtime.Serialization.Formatters/src/Resources/Strings.resx index df3d7f43119..47c6bf98bed 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/Resources/Strings.resx +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/Resources/Strings.resx @@ -249,4 +249,7 @@ BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. + + BinaryFormatter serialization and deserialization are not supported on this platform. See https://aka.ms/binaryformatter for more information. + diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.PlatformNotSupported.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.PlatformNotSupported.cs index 59970dabe4a..1e194973e26 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.PlatformNotSupported.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.PlatformNotSupported.cs @@ -11,11 +11,11 @@ public sealed partial class BinaryFormatter : IFormatter [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] [RequiresUnreferencedCode(IFormatter.RequiresUnreferencedCodeMessage)] public object Deserialize(Stream serializationStream) - => throw new PlatformNotSupportedException(SR.BinaryFormatter_SerializationDisallowed); + => throw new PlatformNotSupportedException(SR.BinaryFormatter_SerializationNotSupportedOnThisPlatform); [Obsolete(Obsoletions.BinaryFormatterMessage, DiagnosticId = Obsoletions.BinaryFormatterDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] [RequiresUnreferencedCode(IFormatter.RequiresUnreferencedCodeMessage)] public void Serialize(Stream serializationStream, object graph) - => throw new PlatformNotSupportedException(SR.BinaryFormatter_SerializationDisallowed); + => throw new PlatformNotSupportedException(SR.BinaryFormatter_SerializationNotSupportedOnThisPlatform); } } -- GitLab