ISerializable cleanup (#11873)
authorMorgan Brown <morganbr@users.noreply.github.com>
Sat, 27 May 2017 00:45:37 +0000 (17:45 -0700)
committerGitHub <noreply@github.com>
Sat, 27 May 2017 00:45:37 +0000 (17:45 -0700)
commitb479cee9fdcee2cb4035fda788d34e724e32a222
treef6e03e2ff5da5554751230fdda129a3a74eaf675
parentc1bf59fbe4f0c54020ad9990bad33ccda4ae4519
ISerializable cleanup (#11873)

Changes to throw PlatformNotSupportedException from ISerializable.GetObjectData and serialization constructors on non-Serializable types. Also removes private serialization constructors and some unneeded code that was used to support serializing non-serializable types. A few tests testing GetObjectData implementations are also removed. For Exception types, we call base instead of throwing from GetObjectData to be consistent with the many Exceptions that don't override GetObjectData
130 files changed:
src/mscorlib/System.Private.CoreLib.csproj
src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
src/mscorlib/shared/System/ApplicationException.cs
src/mscorlib/shared/System/ArgumentException.cs
src/mscorlib/shared/System/ArgumentNullException.cs
src/mscorlib/shared/System/ArgumentOutOfRangeException.cs
src/mscorlib/shared/System/ArithmeticException.cs
src/mscorlib/shared/System/ArrayTypeMismatchException.cs
src/mscorlib/shared/System/BadImageFormatException.cs
src/mscorlib/shared/System/Collections/Generic/KeyNotFoundException.cs
src/mscorlib/shared/System/DBNull.cs
src/mscorlib/shared/System/DataMisalignedException.cs
src/mscorlib/shared/System/DivideByZeroException.cs
src/mscorlib/shared/System/DllNotFoundException.cs
src/mscorlib/shared/System/DuplicateWaitObjectException.cs
src/mscorlib/shared/System/EntryPointNotFoundException.cs
src/mscorlib/shared/System/ExecutionEngineException.cs
src/mscorlib/shared/System/FieldAccessException.cs
src/mscorlib/shared/System/FormatException.cs
src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs
src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs
src/mscorlib/shared/System/IO/EndOfStreamException.cs
src/mscorlib/shared/System/IO/FileLoadException.cs
src/mscorlib/shared/System/IO/FileNotFoundException.cs
src/mscorlib/shared/System/IO/PathTooLongException.cs
src/mscorlib/shared/System/IndexOutOfRangeException.cs
src/mscorlib/shared/System/InsufficientExecutionStackException.cs
src/mscorlib/shared/System/InvalidCastException.cs
src/mscorlib/shared/System/InvalidOperationException.cs
src/mscorlib/shared/System/InvalidProgramException.cs
src/mscorlib/shared/System/InvalidTimeZoneException.cs
src/mscorlib/shared/System/MemberAccessException.cs
src/mscorlib/shared/System/MethodAccessException.cs
src/mscorlib/shared/System/MissingMethodException.cs
src/mscorlib/shared/System/MulticastNotSupportedException.cs
src/mscorlib/shared/System/NotFiniteNumberException.cs
src/mscorlib/shared/System/NotImplementedException.cs
src/mscorlib/shared/System/NotSupportedException.cs
src/mscorlib/shared/System/NullReferenceException.cs
src/mscorlib/shared/System/ObjectDisposedException.cs
src/mscorlib/shared/System/OperationCanceledException.cs
src/mscorlib/shared/System/OverflowException.cs
src/mscorlib/shared/System/PlatformNotSupportedException.cs
src/mscorlib/shared/System/RankException.cs
src/mscorlib/shared/System/Reflection/AmbiguousMatchException.cs
src/mscorlib/shared/System/Reflection/Assembly.cs
src/mscorlib/shared/System/Reflection/CustomAttributeFormatException.cs
src/mscorlib/shared/System/Reflection/InvalidFilterCriteriaException.cs
src/mscorlib/shared/System/Reflection/MemberInfoSerializationHolder.cs [deleted file]
src/mscorlib/shared/System/Reflection/Missing.cs
src/mscorlib/shared/System/Reflection/Module.cs
src/mscorlib/shared/System/Reflection/Pointer.cs
src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs
src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs
src/mscorlib/shared/System/Reflection/TargetException.cs
src/mscorlib/shared/System/Reflection/TargetInvocationException.cs
src/mscorlib/shared/System/Reflection/TargetParameterCountException.cs
src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs
src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs
src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs
src/mscorlib/shared/System/Runtime/Serialization/SerializationException.cs
src/mscorlib/shared/System/Security/CryptographicException.cs
src/mscorlib/shared/System/Security/SecurityException.cs
src/mscorlib/shared/System/Security/VerificationException.cs
src/mscorlib/shared/System/StackOverflowException.cs
src/mscorlib/shared/System/SystemException.cs
src/mscorlib/shared/System/Text/UTF8Encoding.cs
src/mscorlib/shared/System/Text/UnicodeEncoding.cs
src/mscorlib/shared/System/Threading/AbandonedMutexException.cs
src/mscorlib/shared/System/Threading/ExecutionContext.cs
src/mscorlib/shared/System/Threading/LockRecursionException.cs
src/mscorlib/shared/System/Threading/SemaphoreFullException.cs
src/mscorlib/shared/System/Threading/SynchronizationLockException.cs
src/mscorlib/shared/System/Threading/Tasks/TaskCanceledException.cs
src/mscorlib/shared/System/Threading/Tasks/TaskSchedulerException.cs
src/mscorlib/shared/System/Threading/ThreadAbortException.cs
src/mscorlib/shared/System/Threading/ThreadStartException.cs
src/mscorlib/shared/System/Threading/ThreadStateException.cs
src/mscorlib/shared/System/Threading/WaitHandleCannotBeOpenedException.cs
src/mscorlib/shared/System/TimeZoneNotFoundException.cs
src/mscorlib/shared/System/TimeoutException.cs
src/mscorlib/shared/System/TypeAccessException.cs
src/mscorlib/shared/System/TypeInitializationException.cs
src/mscorlib/shared/System/TypeUnloadedException.cs
src/mscorlib/shared/System/UnauthorizedAccessException.cs
src/mscorlib/shared/System/UnitySerializationHolder.cs [deleted file]
src/mscorlib/src/System/AccessViolationException.cs
src/mscorlib/src/System/AppDomainUnloadedException.cs
src/mscorlib/src/System/Collections/Comparer.cs
src/mscorlib/src/System/Collections/Hashtable.cs
src/mscorlib/src/System/Delegate.cs
src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs
src/mscorlib/src/System/Empty.cs
src/mscorlib/src/System/Exception.cs
src/mscorlib/src/System/IO/DriveNotFoundException.cs
src/mscorlib/src/System/IO/IOException.cs
src/mscorlib/src/System/InsufficientMemoryException.cs
src/mscorlib/src/System/MissingFieldException.cs
src/mscorlib/src/System/MissingMemberException.cs
src/mscorlib/src/System/OutOfMemoryException.cs
src/mscorlib/src/System/Reflection/AssemblyName.cs
src/mscorlib/src/System/Reflection/MemberSerializationStringGenerator.cs [deleted file]
src/mscorlib/src/System/Reflection/RuntimeAssembly.cs
src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs
src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs
src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs
src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs
src/mscorlib/src/System/Reflection/RuntimeModule.cs
src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs
src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs
src/mscorlib/src/System/RtType.cs
src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs
src/mscorlib/src/System/Runtime/InteropServices/COMException.cs
src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs
src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs
src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs
src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs
src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs
src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs
src/mscorlib/src/System/RuntimeHandles.cs
src/mscorlib/src/System/Text/DecoderExceptionFallback.cs
src/mscorlib/src/System/Text/DecoderNLS.cs
src/mscorlib/src/System/Text/EncoderExceptionFallback.cs
src/mscorlib/src/System/Text/EncoderNLS.cs
src/mscorlib/src/System/Text/Encoding.cs
src/mscorlib/src/System/Text/Latin1Encoding.cs
src/mscorlib/src/System/Text/UTF7Encoding.cs
src/mscorlib/src/System/Threading/ThreadInterruptedException.cs
src/mscorlib/src/System/TypeLoadException.cs
tests/src/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs