diff options
author | Jan Kotas <jkotas@microsoft.com> | 2019-06-25 17:24:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-25 17:24:40 -0700 |
commit | 27b7c2e673c85568374681d1a3270c60946fc3cd (patch) | |
tree | 95b62acc3af6643b139ecc87e1ad497bc6db3180 /src/System.Private.CoreLib | |
parent | 74ccf988e52f083e24b5ac3bc0db0702588b2572 (diff) | |
download | coreclr-27b7c2e673c85568374681d1a3270c60946fc3cd.tar.gz coreclr-27b7c2e673c85568374681d1a3270c60946fc3cd.tar.bz2 coreclr-27b7c2e673c85568374681d1a3270c60946fc3cd.zip |
Delete DeserializationBlockedException (#25393)
Contributes to dotnet/corefx#36723
Diffstat (limited to 'src/System.Private.CoreLib')
3 files changed, 3 insertions, 43 deletions
diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems index 34dd829812..0e914fcf6b 100644 --- a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems +++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems @@ -710,7 +710,6 @@ <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\AssemblyLoadContext.cs" Condition="'$(TargetsCoreRT)' != 'true'" /> <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\LibraryNameVariation.cs" /> <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Remoting\ObjectHandle.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Serialization\DeserializationBlockedException.cs" /> <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Serialization\DeserializationToken.cs" /> <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Serialization\DeserializationTracker.cs" /> <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Serialization\IDeserializationCallback.cs" /> diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Serialization/DeserializationBlockedException.cs b/src/System.Private.CoreLib/shared/System/Runtime/Serialization/DeserializationBlockedException.cs deleted file mode 100644 index 232dc4da12..0000000000 --- a/src/System.Private.CoreLib/shared/System/Runtime/Serialization/DeserializationBlockedException.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.Serialization -{ - // Thrown when a dangerous action would be performed during deserialization - [Serializable] - [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] - public sealed class DeserializationBlockedException : SerializationException - { - // Creates a new DeserializationBlockedException with its message - // string set to a default message. - public DeserializationBlockedException() - : base(SR.Serialization_DangerousDeserialization) - { - HResult = HResults.COR_E_SERIALIZATION; - } - - // Creates a new DeserializationBlockedException with a message indicating an opt-out switch - // for a particular part of SerializationGuard - public DeserializationBlockedException(string? message) - : base(message) - { - HResult = HResults.COR_E_SERIALIZATION; - } - - public DeserializationBlockedException(Exception? innerException) - : base(SR.Serialization_DangerousDeserialization, innerException) - { - HResult = HResults.COR_E_SERIALIZATION; - } - - private DeserializationBlockedException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - } -} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Serialization/SerializationInfo.cs b/src/System.Private.CoreLib/shared/System/Runtime/Serialization/SerializationInfo.cs index afcf0ed00c..a11fa94bb8 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Serialization/SerializationInfo.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Serialization/SerializationInfo.cs @@ -69,13 +69,13 @@ namespace System.Runtime.Serialization } } - // Throws a DeserializationBlockedException if dangerous deserialization is currently + // Throws a SerializationException if dangerous deserialization is currently // in progress public static void ThrowIfDeserializationInProgress() { if (DeserializationInProgress) { - throw new DeserializationBlockedException(); + throw new SerializationException(SR.Serialization_DangerousDeserialization); } } @@ -118,7 +118,7 @@ namespace System.Runtime.Serialization { if (DeserializationInProgress) { - throw new DeserializationBlockedException(SR.Format(SR.Serialization_DangerousDeserialization_Switch, SwitchPrefix + switchSuffix)); + throw new SerializationException(SR.Format(SR.Serialization_DangerousDeserialization_Switch, SwitchPrefix + switchSuffix)); } } else |