From 6ba890bba87074f6673f991544bbdfc9d46ce571 Mon Sep 17 00:00:00 2001 From: Morgan Brown Date: Fri, 19 May 2017 19:57:42 -0700 Subject: [PATCH 1/2] Removes SerializableAttribute from CoreCLR types not intended to be serializable as well as adding special handling to MulticastDelegate to prevent serializing delegates (which can't be correctly serialized cross platform/runtime). --- src/mscorlib/Resources/Strings.resx | 3 + src/mscorlib/System.Private.CoreLib.csproj | 3 +- .../shared/System/ApplicationException.cs | 1 - .../shared/System/ArgumentException.cs | 1 - .../shared/System/ArgumentNullException.cs | 1 - .../System/ArgumentOutOfRangeException.cs | 1 - .../shared/System/ArithmeticException.cs | 1 - .../System/ArrayTypeMismatchException.cs | 1 - .../shared/System/AttributeUsageAttribute.cs | 1 - .../shared/System/BadImageFormatException.cs | 1 - .../shared/System/CLSCompliantAttribute.cs | 1 - src/mscorlib/shared/System/CharEnumerator.cs | 1 - .../Generic/KeyNotFoundException.cs | 1 - .../shared/System/CurrentSystemTimeZone.cs | 1 - src/mscorlib/shared/System/DBNull.cs | 1 - .../shared/System/DataMisalignedException.cs | 1 - src/mscorlib/shared/System/DefaultBinder.cs | 1 - .../Diagnostics/ConditionalAttribute.cs | 1 - .../Tracing/EventSourceException.cs | 3 - .../shared/System/DivideByZeroException.cs | 1 - .../shared/System/DllNotFoundException.cs | 1 - .../System/DuplicateWaitObjectException.cs | 1 - .../System/EntryPointNotFoundException.cs | 1 - src/mscorlib/shared/System/EventArgs.cs | 1 - .../shared/System/ExecutionEngineException.cs | 1 - .../shared/System/FieldAccessException.cs | 1 - src/mscorlib/shared/System/FlagsAttribute.cs | 1 - src/mscorlib/shared/System/FormatException.cs | 1 - .../Globalization/ChineseLunisolarCalendar.cs | 1 - .../Globalization/CultureNotFoundException.cs | 1 - .../Globalization/DateTimeFormatInfo.cs | 1 - .../System/Globalization/DaylightTime.cs | 1 - .../EastAsianLunisolarCalendar.cs | 1 - .../System/Globalization/HebrewCalendar.cs | 1 - .../System/Globalization/HijriCalendar.cs | 1 - .../System/Globalization/JapaneseCalendar.cs | 1 - .../JapaneseLunisolarCalendar.cs | 1 - .../System/Globalization/JulianCalendar.cs | 1 - .../System/Globalization/KoreanCalendar.cs | 1 - .../Globalization/KoreanLunisolarCalendar.cs | 1 - .../System/Globalization/NumberFormatInfo.cs | 1 - .../System/Globalization/PersianCalendar.cs | 1 - .../shared/System/Globalization/SortKey.cs | 1 - .../shared/System/Globalization/StringInfo.cs | 1 - .../System/Globalization/TaiwanCalendar.cs | 1 - .../Globalization/TaiwanLunisolarCalendar.cs | 1 - .../Globalization/ThaiBuddhistCalendar.cs | 1 - .../System/Globalization/UmAlQuraCalendar.cs | 1 - .../System/IO/DirectoryNotFoundException.cs | 1 - .../shared/System/IO/EndOfStreamException.cs | 1 - .../shared/System/IO/FileLoadException.cs | 1 - .../shared/System/IO/FileNotFoundException.cs | 1 - .../shared/System/IO/PathTooLongException.cs | 1 - .../shared/System/IndexOutOfRangeException.cs | 1 - .../InsufficientExecutionStackException.cs | 1 - .../shared/System/InvalidCastException.cs | 1 - .../System/InvalidOperationException.cs | 1 - .../shared/System/InvalidProgramException.cs | 1 - .../shared/System/InvalidTimeZoneException.cs | 1 - .../shared/System/MarshalByRefObject.cs | 1 - .../shared/System/MemberAccessException.cs | 1 - .../shared/System/MethodAccessException.cs | 1 - .../shared/System/MissingMethodException.cs | 1 - .../System/MulticastNotSupportedException.cs | 1 - .../shared/System/NotFiniteNumberException.cs | 1 - .../shared/System/NotImplementedException.cs | 1 - .../shared/System/NotSupportedException.cs | 1 - .../shared/System/NullReferenceException.cs | 1 - .../shared/System/ObjectDisposedException.cs | 1 - .../shared/System/ObsoleteAttribute.cs | 1 - .../System/OperationCanceledException.cs | 1 - .../shared/System/OverflowException.cs | 1 - .../System/PlatformNotSupportedException.cs | 1 - src/mscorlib/shared/System/Random.cs | 1 - src/mscorlib/shared/System/RankException.cs | 1 - .../Reflection/AmbiguousMatchException.cs | 1 - .../CustomAttributeFormatException.cs | 1 - .../Reflection/DefaultMemberAttribute.cs | 1 - .../InvalidFilterCriteriaException.cs | 1 - .../MemberInfoSerializationHolder.cs | 1 - .../shared/System/Reflection/Missing.cs | 1 - .../System/Reflection/ParameterModifier.cs | 1 - .../shared/System/Reflection/Pointer.cs | 1 - .../Reflection/ReflectionTypeLoadException.cs | 1 - .../System/Reflection/StrongNameKeyPair.cs | 1 - .../System/Reflection/TargetException.cs | 1 - .../Reflection/TargetInvocationException.cs | 1 - .../TargetParameterCountException.cs | 1 - .../shared/System/Reflection/TypeDelegator.cs | 1 - .../MissingManifestResourceException.cs | 1 - .../MissingSatelliteAssemblyException.cs | 1 - .../AsyncStateMachineAttribute.cs | 1 - .../CompilationRelaxationsAttribute.cs | 1 - .../CompilerGeneratedAttribute.cs | 1 - .../CompilerGlobalScopeAttribute.cs | 1 - .../DefaultDependencyAttribute.cs | 1 - .../CompilerServices/DependencyAttribute.cs | 1 - .../FixedAddressValueTypeAttribute.cs | 1 - .../CompilerServices/IndexerNameAttribute.cs | 1 - .../IteratorStateMachineAttribute.cs | 1 - .../ReferenceAssemblyAttribute.cs | 1 - .../RuntimeCompatibilityAttribute.cs | 1 - .../CompilerServices/StateMachineAttribute.cs | 1 - .../StringFreezingAttribute.cs | 1 - .../UnsafeValueTypeAttribute.cs | 1 - .../InteropServices/ExternalException.cs | 1 - .../Serialization/SerializationException.cs | 1 - .../Runtime/Serialization/StreamingContext.cs | 1 - .../System/Security/CryptographicException.cs | 1 - .../System/Security/SecurityException.cs | 1 - .../System/Security/VerificationException.cs | 1 - .../shared/System/StackOverflowException.cs | 1 - src/mscorlib/shared/System/SystemException.cs | 1 - .../shared/System/Text/ASCIIEncoding.cs | 2 - src/mscorlib/shared/System/Text/Decoder.cs | 1 - src/mscorlib/shared/System/Text/Encoder.cs | 1 - .../shared/System/Text/EncodingInfo.cs | 1 - .../shared/System/Text/EncodingNLS.cs | 1 - .../shared/System/Text/UTF32Encoding.cs | 2 - .../shared/System/Text/UTF8Encoding.cs | 4 - .../shared/System/Text/UnicodeEncoding.cs | 2 - .../shared/System/ThreadStaticAttribute.cs | 1 - .../Threading/AbandonedMutexException.cs | 1 - .../System/Threading/ExecutionContext.cs | 1 - .../Threading/LockRecursionException.cs | 1 - .../Threading/SemaphoreFullException.cs | 1 - .../Threading/SynchronizationLockException.cs | 1 - .../Threading/Tasks/TaskCanceledException.cs | 1 - .../Threading/Tasks/TaskSchedulerException.cs | 1 - .../System/Threading/ThreadAbortException.cs | 1 - .../System/Threading/ThreadStartException.cs | 1 - .../System/Threading/ThreadStateException.cs | 1 - .../WaitHandleCannotBeOpenedException.cs | 1 - .../System/TimeZoneNotFoundException.cs | 1 - .../shared/System/TimeoutException.cs | 1 - .../shared/System/TypeAccessException.cs | 1 - .../System/TypeInitializationException.cs | 1 - .../shared/System/TypeUnloadedException.cs | 1 - .../System/UnauthorizedAccessException.cs | 1 - .../System/UnhandledExceptionEventArgs.cs | 1 - .../shared/System/UnitySerializationHolder.cs | 1 - src/mscorlib/shared/System/Void.cs | 1 - .../src/Microsoft/Win32/Win32Native.cs | 2 - .../src/System/AccessViolationException.cs | 1 - src/mscorlib/src/System/AppDomainSetup.cs | 1 - .../src/System/AppDomainUnloadedException.cs | 1 - src/mscorlib/src/System/Array.cs | 3 - src/mscorlib/src/System/ArraySegment.cs | 1 - .../src/System/Collections/Comparer.cs | 1 - .../System/Collections/CompatibleComparer.cs | 1 - .../Collections/Concurrent/ConcurrentQueue.cs | 1 - .../EmptyReadOnlyDictionaryInternal.cs | 1 - .../Collections/Generic/ArraySortHelper.cs | 1 - .../System/Collections/Generic/Comparer.cs | 6 - .../System/Collections/Generic/Dictionary.cs | 5 - .../src/System/Collections/Generic/List.cs | 1 - .../src/System/Collections/Hashtable.cs | 5 - .../ObjectModel/ReadOnlyDictionary.cs | 4 - src/mscorlib/src/System/Currency.cs | 1 - src/mscorlib/src/System/Delegate.cs | 1 - .../src/System/DelegateSerializationHolder.cs | 286 ------------------ .../src/System/Diagnostics/AssertFilter.cs | 1 - .../Diagnostics/Contracts/ContractsBCL.cs | 1 - .../System/Diagnostics/DebuggerAttributes.cs | 3 - .../Diagnostics/EditAndContinueHelper.cs | 1 - .../src/System/Diagnostics/LogSwitch.cs | 1 - .../src/System/Diagnostics/Stackframe.cs | 1 - .../src/System/Diagnostics/Stacktrace.cs | 2 - src/mscorlib/src/System/Empty.cs | 1 - .../src/System/Globalization/Calendar.cs | 1 - .../src/System/Globalization/CultureInfo.cs | 1 - .../Globalization/EncodingDataItem.Unix.cs | 1 - .../System/Globalization/EncodingDataItem.cs | 1 - .../System/Globalization/GregorianCalendar.cs | 3 - .../Globalization/GregorianCalendarHelper.cs | 2 - .../src/System/Globalization/RegionInfo.cs | 1 - .../Globalization/TextElementEnumerator.cs | 1 - .../src/System/Globalization/TextInfo.cs | 1 - src/mscorlib/src/System/IO/BinaryWriter.cs | 1 - .../src/System/IO/DriveNotFoundException.cs | 1 - src/mscorlib/src/System/IO/IOException.cs | 1 - src/mscorlib/src/System/IO/MemoryStream.cs | 1 - src/mscorlib/src/System/IO/Stream.cs | 3 - src/mscorlib/src/System/IO/StreamReader.cs | 1 - src/mscorlib/src/System/IO/TextReader.cs | 3 - .../src/System/InsufficientMemoryException.cs | 1 - .../src/System/MissingFieldException.cs | 1 - .../src/System/MissingMemberException.cs | 1 - src/mscorlib/src/System/MulticastDelegate.cs | 45 +-- src/mscorlib/src/System/Object.cs | 1 - src/mscorlib/src/System/OleAutBinder.cs | 1 - .../src/System/OutOfMemoryException.cs | 1 - .../src/System/Reflection/AssemblyName.cs | 1 - .../src/System/Reflection/CustomAttribute.cs | 8 - .../src/System/Reflection/Emit/EventToken.cs | 1 - .../src/System/Reflection/Emit/FieldToken.cs | 1 - .../src/System/Reflection/Emit/Label.cs | 1 - .../src/System/Reflection/Emit/MethodToken.cs | 1 - .../Reflection/Emit/ModuleBuilderData.cs | 1 - .../System/Reflection/Emit/ParameterToken.cs | 1 - .../System/Reflection/Emit/PropertyToken.cs | 1 - .../src/System/Reflection/Emit/StringToken.cs | 1 - .../src/System/Reflection/Emit/TypeToken.cs | 1 - .../src/System/Reflection/MdFieldInfo.cs | 1 - .../src/System/Reflection/MdImport.cs | 2 - .../src/System/Reflection/RtFieldInfo.cs | 1 - .../src/System/Reflection/RuntimeAssembly.cs | 1 - .../Reflection/RuntimeConstructorInfo.cs | 1 - .../src/System/Reflection/RuntimeEventInfo.cs | 1 - .../src/System/Reflection/RuntimeFieldInfo.cs | 1 - .../System/Reflection/RuntimeMethodInfo.cs | 1 - .../src/System/Reflection/RuntimeModule.cs | 1 - .../System/Reflection/RuntimeParameterInfo.cs | 1 - .../System/Reflection/RuntimePropertyInfo.cs | 1 - .../src/System/Resources/ResourceManager.cs | 1 - .../src/System/Resources/ResourceSet.cs | 1 - src/mscorlib/src/System/RtType.cs | 2 - .../CustomConstantAttribute.cs | 1 - .../DateTimeConstantAttribute.cs | 1 - .../DecimalConstantAttribute.cs | 1 - .../CompilerServices/MethodImplAttribute.cs | 1 - .../RuntimeWrappedException.cs | 1 - .../InteropServices/ArrayWithOffset.cs | 1 - .../Runtime/InteropServices/BStrWrapper.cs | 1 - .../Runtime/InteropServices/COMException.cs | 1 - .../InteropServices/ComTypes/ITypeLib.cs | 1 - .../InteropServices/CurrencyWrapper.cs | 1 - .../InteropServices/DispatchWrapper.cs | 1 - .../Runtime/InteropServices/ErrorWrapper.cs | 1 - .../InvalidComObjectException.cs | 1 - .../InvalidOleVariantTypeException.cs | 1 - .../MarshalDirectiveException.cs | 1 - .../Runtime/InteropServices/SEHException.cs | 1 - .../SafeArrayRankMismatchException.cs | 1 - .../SafeArrayTypeMismatchException.cs | 1 - .../Runtime/InteropServices/UnknownWrapper.cs | 1 - .../Runtime/InteropServices/VariantWrapper.cs | 2 - .../WindowsRuntime/ConstantSplittableMap.cs | 2 - .../WindowsRuntime/DictionaryKeyCollection.cs | 2 - .../DictionaryValueCollection.cs | 2 - .../IMapViewToIReadOnlyDictionaryAdapter.cs | 4 - src/mscorlib/src/System/RuntimeHandles.cs | 3 - .../src/System/Text/DecoderBestFitFallback.cs | 1 - .../System/Text/DecoderExceptionFallback.cs | 2 - .../src/System/Text/DecoderFallback.cs | 1 - src/mscorlib/src/System/Text/DecoderNLS.cs | 1 - .../System/Text/DecoderReplacementFallback.cs | 1 - .../src/System/Text/EncoderBestFitFallback.cs | 1 - .../System/Text/EncoderExceptionFallback.cs | 2 - .../src/System/Text/EncoderFallback.cs | 1 - src/mscorlib/src/System/Text/EncoderNLS.cs | 1 - .../System/Text/EncoderReplacementFallback.cs | 1 - src/mscorlib/src/System/Text/Encoding.cs | 3 - .../src/System/Text/Latin1Encoding.cs | 1 - src/mscorlib/src/System/Text/UTF7Encoding.cs | 4 - .../Threading/ThreadInterruptedException.cs | 1 - src/mscorlib/src/System/TypeLoadException.cs | 1 - src/mscorlib/src/System/Variant.cs | 1 - 258 files changed, 5 insertions(+), 648 deletions(-) delete mode 100644 src/mscorlib/src/System/DelegateSerializationHolder.cs diff --git a/src/mscorlib/Resources/Strings.resx b/src/mscorlib/Resources/Strings.resx index d4fe40970d45..cbf969e8fef2 100644 --- a/src/mscorlib/Resources/Strings.resx +++ b/src/mscorlib/Resources/Strings.resx @@ -3287,6 +3287,9 @@ Invalid serialized DateTime data. Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. + + Serializing delegates is not supported on this platform. + Insufficient state to deserialize the object. Missing field '{0}'. More information is needed. diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj index 7cb324456755..4142937ab09c 100644 --- a/src/mscorlib/System.Private.CoreLib.csproj +++ b/src/mscorlib/System.Private.CoreLib.csproj @@ -325,7 +325,6 @@ - @@ -734,4 +733,4 @@ $(IntermediateOutputPath)\System.Private.CoreLib.res - + \ No newline at end of file diff --git a/src/mscorlib/shared/System/ApplicationException.cs b/src/mscorlib/shared/System/ApplicationException.cs index 900feb57f968..89c665c26d3a 100644 --- a/src/mscorlib/shared/System/ApplicationException.cs +++ b/src/mscorlib/shared/System/ApplicationException.cs @@ -23,7 +23,6 @@ namespace System // ApplicationException extends but adds no new functionality to // RecoverableException. // - [Serializable] public class ApplicationException : Exception { // Creates a new ApplicationException with its message string set to diff --git a/src/mscorlib/shared/System/ArgumentException.cs b/src/mscorlib/shared/System/ArgumentException.cs index 96afbe10d9d5..ce045f1fd1c8 100644 --- a/src/mscorlib/shared/System/ArgumentException.cs +++ b/src/mscorlib/shared/System/ArgumentException.cs @@ -20,7 +20,6 @@ namespace System // the contract of the method. Ideally it should give a meaningful error // message describing what was wrong and which parameter is incorrect. // - [Serializable] public class ArgumentException : SystemException { private String _paramName; diff --git a/src/mscorlib/shared/System/ArgumentNullException.cs b/src/mscorlib/shared/System/ArgumentNullException.cs index 3a86223ccf2c..343cadc69307 100644 --- a/src/mscorlib/shared/System/ArgumentNullException.cs +++ b/src/mscorlib/shared/System/ArgumentNullException.cs @@ -18,7 +18,6 @@ namespace System // The ArgumentException is thrown when an argument // is null when it shouldn't be. // - [Serializable] public class ArgumentNullException : ArgumentException { // Creates a new ArgumentNullException with its message diff --git a/src/mscorlib/shared/System/ArgumentOutOfRangeException.cs b/src/mscorlib/shared/System/ArgumentOutOfRangeException.cs index eeeadcbfa179..08592aa2987a 100644 --- a/src/mscorlib/shared/System/ArgumentOutOfRangeException.cs +++ b/src/mscorlib/shared/System/ArgumentOutOfRangeException.cs @@ -18,7 +18,6 @@ namespace System { // The ArgumentOutOfRangeException is thrown when an argument // is outside the legal range for that argument. - [Serializable] public class ArgumentOutOfRangeException : ArgumentException { private Object _actualValue; diff --git a/src/mscorlib/shared/System/ArithmeticException.cs b/src/mscorlib/shared/System/ArithmeticException.cs index 081ba454f57b..cd7796525e6d 100644 --- a/src/mscorlib/shared/System/ArithmeticException.cs +++ b/src/mscorlib/shared/System/ArithmeticException.cs @@ -18,7 +18,6 @@ namespace System // The ArithmeticException is thrown when overflow or underflow // occurs. // - [Serializable] public class ArithmeticException : SystemException { // Creates a new ArithmeticException with its message string set to diff --git a/src/mscorlib/shared/System/ArrayTypeMismatchException.cs b/src/mscorlib/shared/System/ArrayTypeMismatchException.cs index 3e941fdf8e28..b6ce5fa4a72d 100644 --- a/src/mscorlib/shared/System/ArrayTypeMismatchException.cs +++ b/src/mscorlib/shared/System/ArrayTypeMismatchException.cs @@ -18,7 +18,6 @@ namespace System // The ArrayMismatchException is thrown when an attempt to store // an object of the wrong type within an array occurs. // - [Serializable] public class ArrayTypeMismatchException : SystemException { // Creates a new ArrayMismatchException with its message string set to diff --git a/src/mscorlib/shared/System/AttributeUsageAttribute.cs b/src/mscorlib/shared/System/AttributeUsageAttribute.cs index 6f9aeb20f3a4..219dc43e1500 100644 --- a/src/mscorlib/shared/System/AttributeUsageAttribute.cs +++ b/src/mscorlib/shared/System/AttributeUsageAttribute.cs @@ -16,7 +16,6 @@ namespace System { /* By default, attributes are inherited and multiple attributes are not allowed */ - [Serializable] [AttributeUsage(AttributeTargets.Class, Inherited = true)] public sealed class AttributeUsageAttribute : Attribute { diff --git a/src/mscorlib/shared/System/BadImageFormatException.cs b/src/mscorlib/shared/System/BadImageFormatException.cs index 150330b5862a..2ceaa8b6c320 100644 --- a/src/mscorlib/shared/System/BadImageFormatException.cs +++ b/src/mscorlib/shared/System/BadImageFormatException.cs @@ -17,7 +17,6 @@ namespace System { - [Serializable] public partial class BadImageFormatException : SystemException { private String _fileName; // The name of the corrupt PE file. diff --git a/src/mscorlib/shared/System/CLSCompliantAttribute.cs b/src/mscorlib/shared/System/CLSCompliantAttribute.cs index e03600d13234..d895b5ac7166 100644 --- a/src/mscorlib/shared/System/CLSCompliantAttribute.cs +++ b/src/mscorlib/shared/System/CLSCompliantAttribute.cs @@ -13,7 +13,6 @@ namespace System { - [Serializable] [AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)] public sealed class CLSCompliantAttribute : Attribute { diff --git a/src/mscorlib/shared/System/CharEnumerator.cs b/src/mscorlib/shared/System/CharEnumerator.cs index 4dbd5cd58706..ea9915a7c4f3 100644 --- a/src/mscorlib/shared/System/CharEnumerator.cs +++ b/src/mscorlib/shared/System/CharEnumerator.cs @@ -17,7 +17,6 @@ namespace System { - [Serializable] public sealed class CharEnumerator : IEnumerator, IEnumerator, IDisposable, ICloneable { private String _str; diff --git a/src/mscorlib/shared/System/Collections/Generic/KeyNotFoundException.cs b/src/mscorlib/shared/System/Collections/Generic/KeyNotFoundException.cs index 1fca7732ae51..fa4de8314fd7 100644 --- a/src/mscorlib/shared/System/Collections/Generic/KeyNotFoundException.cs +++ b/src/mscorlib/shared/System/Collections/Generic/KeyNotFoundException.cs @@ -7,7 +7,6 @@ namespace System.Collections.Generic { - [Serializable] public class KeyNotFoundException : SystemException { public KeyNotFoundException() diff --git a/src/mscorlib/shared/System/CurrentSystemTimeZone.cs b/src/mscorlib/shared/System/CurrentSystemTimeZone.cs index 2d848397a9b3..3f17d6f3717e 100644 --- a/src/mscorlib/shared/System/CurrentSystemTimeZone.cs +++ b/src/mscorlib/shared/System/CurrentSystemTimeZone.cs @@ -28,7 +28,6 @@ namespace System { [Obsolete("System.CurrentSystemTimeZone has been deprecated. Please investigate the use of System.TimeZoneInfo.Local instead.")] - [Serializable] internal partial class CurrentSystemTimeZone : TimeZone { // Standard offset in ticks to the Universal time if diff --git a/src/mscorlib/shared/System/DBNull.cs b/src/mscorlib/shared/System/DBNull.cs index 486eb72f2acc..507cccb8405a 100644 --- a/src/mscorlib/shared/System/DBNull.cs +++ b/src/mscorlib/shared/System/DBNull.cs @@ -6,7 +6,6 @@ namespace System { - [Serializable] public sealed class DBNull : ISerializable, IConvertible { private DBNull() diff --git a/src/mscorlib/shared/System/DataMisalignedException.cs b/src/mscorlib/shared/System/DataMisalignedException.cs index b1991a048e9a..9c02fc279346 100644 --- a/src/mscorlib/shared/System/DataMisalignedException.cs +++ b/src/mscorlib/shared/System/DataMisalignedException.cs @@ -13,7 +13,6 @@ namespace System { - [Serializable] public sealed class DataMisalignedException : SystemException { public DataMisalignedException() diff --git a/src/mscorlib/shared/System/DefaultBinder.cs b/src/mscorlib/shared/System/DefaultBinder.cs index 3b46d5f4d3ba..9e6a23222143 100644 --- a/src/mscorlib/shared/System/DefaultBinder.cs +++ b/src/mscorlib/shared/System/DefaultBinder.cs @@ -9,7 +9,6 @@ namespace System { //Marked serializable even though it has no state. - [Serializable] #if CORECLR internal #else diff --git a/src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs b/src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs index d5bca6e2088e..416625b779d7 100644 --- a/src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs +++ b/src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs @@ -4,7 +4,6 @@ namespace System.Diagnostics { - [Serializable] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)] public sealed class ConditionalAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs index 88b8da93cdd6..c766a9854754 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs @@ -18,9 +18,6 @@ namespace System.Diagnostics.Tracing /// /// Exception that is thrown when an error occurs during EventSource operation. /// -#if !ES_BUILD_PCL - [Serializable] -#endif public class EventSourceException : Exception { /// diff --git a/src/mscorlib/shared/System/DivideByZeroException.cs b/src/mscorlib/shared/System/DivideByZeroException.cs index 4abd43adaff0..f5911f26974f 100644 --- a/src/mscorlib/shared/System/DivideByZeroException.cs +++ b/src/mscorlib/shared/System/DivideByZeroException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public class DivideByZeroException : ArithmeticException { public DivideByZeroException() diff --git a/src/mscorlib/shared/System/DllNotFoundException.cs b/src/mscorlib/shared/System/DllNotFoundException.cs index c0b343219d94..fc63bc50e38f 100644 --- a/src/mscorlib/shared/System/DllNotFoundException.cs +++ b/src/mscorlib/shared/System/DllNotFoundException.cs @@ -16,7 +16,6 @@ namespace System { - [Serializable] public class DllNotFoundException : TypeLoadException { public DllNotFoundException() diff --git a/src/mscorlib/shared/System/DuplicateWaitObjectException.cs b/src/mscorlib/shared/System/DuplicateWaitObjectException.cs index da29e2ad76a5..d9075dfc81ba 100644 --- a/src/mscorlib/shared/System/DuplicateWaitObjectException.cs +++ b/src/mscorlib/shared/System/DuplicateWaitObjectException.cs @@ -18,7 +18,6 @@ namespace System // The DuplicateWaitObjectException is thrown when an object // appears more than once in the list of objects to WaitAll or WaitAny. // - [Serializable] public class DuplicateWaitObjectException : ArgumentException { private static volatile String s_duplicateWaitObjectMessage = null; diff --git a/src/mscorlib/shared/System/EntryPointNotFoundException.cs b/src/mscorlib/shared/System/EntryPointNotFoundException.cs index 835d33413da2..0859eb4ef322 100644 --- a/src/mscorlib/shared/System/EntryPointNotFoundException.cs +++ b/src/mscorlib/shared/System/EntryPointNotFoundException.cs @@ -16,7 +16,6 @@ namespace System { - [Serializable] public class EntryPointNotFoundException : TypeLoadException { public EntryPointNotFoundException() diff --git a/src/mscorlib/shared/System/EventArgs.cs b/src/mscorlib/shared/System/EventArgs.cs index c0356613dee6..be12af25b68c 100644 --- a/src/mscorlib/shared/System/EventArgs.cs +++ b/src/mscorlib/shared/System/EventArgs.cs @@ -7,7 +7,6 @@ namespace System { // The base class for all event classes. - [Serializable] public class EventArgs { public static readonly EventArgs Empty = new EventArgs(); diff --git a/src/mscorlib/shared/System/ExecutionEngineException.cs b/src/mscorlib/shared/System/ExecutionEngineException.cs index bebfd493a098..ae3a8db8f687 100644 --- a/src/mscorlib/shared/System/ExecutionEngineException.cs +++ b/src/mscorlib/shared/System/ExecutionEngineException.cs @@ -21,7 +21,6 @@ namespace System { [Obsolete("This type previously indicated an unspecified fatal error in the runtime. The runtime no longer raises this exception so this type is obsolete.")] - [Serializable] public sealed class ExecutionEngineException : SystemException { public ExecutionEngineException() diff --git a/src/mscorlib/shared/System/FieldAccessException.cs b/src/mscorlib/shared/System/FieldAccessException.cs index ac62c0fcac3b..109bd77b9581 100644 --- a/src/mscorlib/shared/System/FieldAccessException.cs +++ b/src/mscorlib/shared/System/FieldAccessException.cs @@ -13,7 +13,6 @@ namespace System { - [Serializable] public class FieldAccessException : MemberAccessException { public FieldAccessException() diff --git a/src/mscorlib/shared/System/FlagsAttribute.cs b/src/mscorlib/shared/System/FlagsAttribute.cs index 5f8c108ae4be..4f3ab36bfd5a 100644 --- a/src/mscorlib/shared/System/FlagsAttribute.cs +++ b/src/mscorlib/shared/System/FlagsAttribute.cs @@ -11,7 +11,6 @@ namespace System // should be treated as a bitfield (or set of flags). // An IDE may use this information to provide a richer // development experience. - [Serializable] [AttributeUsage(AttributeTargets.Enum, Inherited = false)] public class FlagsAttribute : Attribute { diff --git a/src/mscorlib/shared/System/FormatException.cs b/src/mscorlib/shared/System/FormatException.cs index c5758e11cd5d..68e1f4fbc9cb 100644 --- a/src/mscorlib/shared/System/FormatException.cs +++ b/src/mscorlib/shared/System/FormatException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public class FormatException : SystemException { public FormatException() diff --git a/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs b/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs index 404add093619..e09011a9d82e 100644 --- a/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs @@ -14,7 +14,6 @@ namespace System.Globalization ** ChineseLunisolar 1901/01/01 2100/12/29 */ - [Serializable] public class ChineseLunisolarCalendar : EastAsianLunisolarCalendar { // diff --git a/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs b/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs index 929f4bb0006e..2b333ee758fc 100644 --- a/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs +++ b/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs @@ -6,7 +6,6 @@ namespace System.Globalization { - [Serializable] public class CultureNotFoundException : ArgumentException { private string _invalidCultureName; // unrecognized culture name diff --git a/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs b/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs index d3f1ea9a4566..5d3239ebfceb 100644 --- a/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs +++ b/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs @@ -49,7 +49,6 @@ internal enum DateTimeFormatFlags } - [Serializable] public sealed class DateTimeFormatInfo : IFormatProvider, ICloneable { // cache for the invariant culture. diff --git a/src/mscorlib/shared/System/Globalization/DaylightTime.cs b/src/mscorlib/shared/System/Globalization/DaylightTime.cs index b3c70e1d10c3..10f074dc24e4 100644 --- a/src/mscorlib/shared/System/Globalization/DaylightTime.cs +++ b/src/mscorlib/shared/System/Globalization/DaylightTime.cs @@ -5,7 +5,6 @@ namespace System.Globalization { // This class represents a starting/ending time for a period of daylight saving time. - [Serializable] public class DaylightTime { private readonly DateTime _start; diff --git a/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs b/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs index d06b13cd7d62..0697b602db4b 100644 --- a/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs @@ -6,7 +6,6 @@ namespace System.Globalization { - [Serializable] public abstract class EastAsianLunisolarCalendar : Calendar { internal const int LeapMonth = 0; diff --git a/src/mscorlib/shared/System/Globalization/HebrewCalendar.cs b/src/mscorlib/shared/System/Globalization/HebrewCalendar.cs index b4f54f8fbba2..6ba4f082f1ff 100644 --- a/src/mscorlib/shared/System/Globalization/HebrewCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/HebrewCalendar.cs @@ -62,7 +62,6 @@ namespace System.Globalization // Gregorian to Hebrew Lunar from 1583 to 2239. - [Serializable] public class HebrewCalendar : Calendar { public static readonly int HebrewEra = 1; diff --git a/src/mscorlib/shared/System/Globalization/HijriCalendar.cs b/src/mscorlib/shared/System/Globalization/HijriCalendar.cs index cafde5fbb853..125248a68520 100644 --- a/src/mscorlib/shared/System/Globalization/HijriCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/HijriCalendar.cs @@ -42,7 +42,6 @@ namespace System.Globalization ** Hijri 0001/01/01 9666/04/03 */ - [Serializable] public partial class HijriCalendar : Calendar { public static readonly int HijriEra = 1; diff --git a/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs b/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs index 4655e08a4ecf..0db1e6517a23 100644 --- a/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs @@ -36,7 +36,6 @@ namespace System.Globalization ============================================================================*/ - [Serializable] public partial class JapaneseCalendar : Calendar { internal static readonly DateTime calendarMinValue = new DateTime(1868, 9, 8); diff --git a/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs b/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs index 95e87f85d726..a90c4e8f216c 100644 --- a/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs @@ -14,7 +14,6 @@ namespace System.Globalization ** JapaneseLunisolar 1960/01/01 2049/12/29 */ - [Serializable] public class JapaneseLunisolarCalendar : EastAsianLunisolarCalendar { // diff --git a/src/mscorlib/shared/System/Globalization/JulianCalendar.cs b/src/mscorlib/shared/System/Globalization/JulianCalendar.cs index f4678c1a8518..8d9429054746 100644 --- a/src/mscorlib/shared/System/Globalization/JulianCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/JulianCalendar.cs @@ -17,7 +17,6 @@ namespace System.Globalization //* Gregorian 0001/01/01 9999/12/31 //* Julia 0001/01/03 9999/10/19 - [Serializable] public class JulianCalendar : Calendar { public static readonly int JulianEra = 1; diff --git a/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs b/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs index b962b1c427e5..ef7495f07dc8 100644 --- a/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs @@ -23,7 +23,6 @@ namespace System.Globalization ============================================================================*/ - [Serializable] public class KoreanCalendar : Calendar { // diff --git a/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs b/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs index d4c71632aa91..8364532c9eea 100644 --- a/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs @@ -14,7 +14,6 @@ namespace System.Globalization ** KoreanLunisolar 918/01/01 2050/13/29 */ - [Serializable] public class KoreanLunisolarCalendar : EastAsianLunisolarCalendar { // diff --git a/src/mscorlib/shared/System/Globalization/NumberFormatInfo.cs b/src/mscorlib/shared/System/Globalization/NumberFormatInfo.cs index 179a7f68d724..9fea694cca27 100644 --- a/src/mscorlib/shared/System/Globalization/NumberFormatInfo.cs +++ b/src/mscorlib/shared/System/Globalization/NumberFormatInfo.cs @@ -41,7 +41,6 @@ namespace System.Globalization // CurrencySymbol "$" String used as local monetary symbol. // - [Serializable] sealed public class NumberFormatInfo : IFormatProvider, ICloneable { // invariantInfo is constant irrespective of your current culture. diff --git a/src/mscorlib/shared/System/Globalization/PersianCalendar.cs b/src/mscorlib/shared/System/Globalization/PersianCalendar.cs index 445bbd6d0c8f..78a081e1b91d 100644 --- a/src/mscorlib/shared/System/Globalization/PersianCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/PersianCalendar.cs @@ -19,7 +19,6 @@ namespace System.Globalization ** Persian 0001/01/01 9378/10/13 */ - [Serializable] public class PersianCalendar : Calendar { public static readonly int PersianEra = 1; diff --git a/src/mscorlib/shared/System/Globalization/SortKey.cs b/src/mscorlib/shared/System/Globalization/SortKey.cs index c6c51a00adba..d65e097cb40d 100644 --- a/src/mscorlib/shared/System/Globalization/SortKey.cs +++ b/src/mscorlib/shared/System/Globalization/SortKey.cs @@ -19,7 +19,6 @@ namespace System.Globalization { - [Serializable] public partial class SortKey { //--------------------------------------------------------------------// diff --git a/src/mscorlib/shared/System/Globalization/StringInfo.cs b/src/mscorlib/shared/System/Globalization/StringInfo.cs index ca57b67eb190..87d1b9f68461 100644 --- a/src/mscorlib/shared/System/Globalization/StringInfo.cs +++ b/src/mscorlib/shared/System/Globalization/StringInfo.cs @@ -19,7 +19,6 @@ namespace System.Globalization { - [Serializable] public class StringInfo { [OptionalField(VersionAdded = 2)] diff --git a/src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs b/src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs index 2e735e0cb932..ec4188161a3f 100644 --- a/src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs @@ -21,7 +21,6 @@ namespace System.Globalization ** Taiwan 01/01/01 8088/12/31 ============================================================================*/ - [Serializable] public class TaiwanCalendar : Calendar { // diff --git a/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs b/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs index 8ba1f278e721..1e2ec62a710c 100644 --- a/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs @@ -15,7 +15,6 @@ namespace System.Globalization ** TaiwanLunisolar 1912/01/01 2050/13/29 */ - [Serializable] public class TaiwanLunisolarCalendar : EastAsianLunisolarCalendar { // Since diff --git a/src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs b/src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs index 9e6e30406c84..e1646bfa8ec7 100644 --- a/src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs @@ -20,7 +20,6 @@ namespace System.Globalization ** Thai 0544/01/01 10542/12/31 ============================================================================*/ - [Serializable] public class ThaiBuddhistCalendar : Calendar { // Initialize our era info. diff --git a/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs b/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs index b7ba6d0112d4..c03ac23d950c 100644 --- a/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs @@ -15,7 +15,6 @@ namespace System.Globalization ** UmAlQura 1318/01/01 1500/12/30 */ - [Serializable] public partial class UmAlQuraCalendar : Calendar { internal const int MinCalendarYear = 1318; diff --git a/src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs b/src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs index 786c2106a347..04e3791a30fa 100644 --- a/src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs +++ b/src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs @@ -12,7 +12,6 @@ namespace System.IO * the Win32 errorcode-as-HRESULT ERROR_PATH_NOT_FOUND (0x80070003) * and STG_E_PATHNOTFOUND (0x80030003). */ - [Serializable] public class DirectoryNotFoundException : IOException { public DirectoryNotFoundException() diff --git a/src/mscorlib/shared/System/IO/EndOfStreamException.cs b/src/mscorlib/shared/System/IO/EndOfStreamException.cs index 7c4b2b744f3c..df9ea175e077 100644 --- a/src/mscorlib/shared/System/IO/EndOfStreamException.cs +++ b/src/mscorlib/shared/System/IO/EndOfStreamException.cs @@ -6,7 +6,6 @@ namespace System.IO { - [Serializable] public class EndOfStreamException : IOException { public EndOfStreamException() diff --git a/src/mscorlib/shared/System/IO/FileLoadException.cs b/src/mscorlib/shared/System/IO/FileLoadException.cs index b5e197c14325..dc8cf0f46085 100644 --- a/src/mscorlib/shared/System/IO/FileLoadException.cs +++ b/src/mscorlib/shared/System/IO/FileLoadException.cs @@ -6,7 +6,6 @@ namespace System.IO { - [Serializable] public partial class FileLoadException : IOException { public FileLoadException() diff --git a/src/mscorlib/shared/System/IO/FileNotFoundException.cs b/src/mscorlib/shared/System/IO/FileNotFoundException.cs index 5d86b8f63557..2a9466540d10 100644 --- a/src/mscorlib/shared/System/IO/FileNotFoundException.cs +++ b/src/mscorlib/shared/System/IO/FileNotFoundException.cs @@ -7,7 +7,6 @@ namespace System.IO { // Thrown when trying to access a file that doesn't exist on disk. - [Serializable] public partial class FileNotFoundException : IOException { public FileNotFoundException() diff --git a/src/mscorlib/shared/System/IO/PathTooLongException.cs b/src/mscorlib/shared/System/IO/PathTooLongException.cs index 613af051cab7..46e9bd65731d 100644 --- a/src/mscorlib/shared/System/IO/PathTooLongException.cs +++ b/src/mscorlib/shared/System/IO/PathTooLongException.cs @@ -8,7 +8,6 @@ namespace System.IO { - [Serializable] public class PathTooLongException : IOException { public PathTooLongException() diff --git a/src/mscorlib/shared/System/IndexOutOfRangeException.cs b/src/mscorlib/shared/System/IndexOutOfRangeException.cs index 4969c2b86d55..0225a600fb83 100644 --- a/src/mscorlib/shared/System/IndexOutOfRangeException.cs +++ b/src/mscorlib/shared/System/IndexOutOfRangeException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public sealed class IndexOutOfRangeException : SystemException { public IndexOutOfRangeException() diff --git a/src/mscorlib/shared/System/InsufficientExecutionStackException.cs b/src/mscorlib/shared/System/InsufficientExecutionStackException.cs index b9a4a12ddd47..be647e3c73b3 100644 --- a/src/mscorlib/shared/System/InsufficientExecutionStackException.cs +++ b/src/mscorlib/shared/System/InsufficientExecutionStackException.cs @@ -6,7 +6,6 @@ namespace System { - [Serializable] public sealed class InsufficientExecutionStackException : SystemException { public InsufficientExecutionStackException() diff --git a/src/mscorlib/shared/System/InvalidCastException.cs b/src/mscorlib/shared/System/InvalidCastException.cs index 01d92b283751..88ee3999b1f4 100644 --- a/src/mscorlib/shared/System/InvalidCastException.cs +++ b/src/mscorlib/shared/System/InvalidCastException.cs @@ -12,7 +12,6 @@ namespace System { - [Serializable] public class InvalidCastException : SystemException { public InvalidCastException() diff --git a/src/mscorlib/shared/System/InvalidOperationException.cs b/src/mscorlib/shared/System/InvalidOperationException.cs index 24a08c8089a4..ab01183ef798 100644 --- a/src/mscorlib/shared/System/InvalidOperationException.cs +++ b/src/mscorlib/shared/System/InvalidOperationException.cs @@ -16,7 +16,6 @@ namespace System { - [Serializable] public class InvalidOperationException : SystemException { public InvalidOperationException() diff --git a/src/mscorlib/shared/System/InvalidProgramException.cs b/src/mscorlib/shared/System/InvalidProgramException.cs index 401b3a0ddb97..a5f798cdd53d 100644 --- a/src/mscorlib/shared/System/InvalidProgramException.cs +++ b/src/mscorlib/shared/System/InvalidProgramException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public sealed class InvalidProgramException : SystemException { public InvalidProgramException() diff --git a/src/mscorlib/shared/System/InvalidTimeZoneException.cs b/src/mscorlib/shared/System/InvalidTimeZoneException.cs index 8f0751c42650..09eed884db45 100644 --- a/src/mscorlib/shared/System/InvalidTimeZoneException.cs +++ b/src/mscorlib/shared/System/InvalidTimeZoneException.cs @@ -6,7 +6,6 @@ namespace System { - [Serializable] public class InvalidTimeZoneException : Exception { public InvalidTimeZoneException() diff --git a/src/mscorlib/shared/System/MarshalByRefObject.cs b/src/mscorlib/shared/System/MarshalByRefObject.cs index 1f1739b9cbee..390b728329e8 100644 --- a/src/mscorlib/shared/System/MarshalByRefObject.cs +++ b/src/mscorlib/shared/System/MarshalByRefObject.cs @@ -4,7 +4,6 @@ namespace System { - [Serializable] public abstract class MarshalByRefObject { protected MarshalByRefObject() diff --git a/src/mscorlib/shared/System/MemberAccessException.cs b/src/mscorlib/shared/System/MemberAccessException.cs index 54eee67b0794..074699dede9b 100644 --- a/src/mscorlib/shared/System/MemberAccessException.cs +++ b/src/mscorlib/shared/System/MemberAccessException.cs @@ -15,7 +15,6 @@ namespace System // The MemberAccessException is thrown when trying to access a class // member fails. // - [Serializable] public class MemberAccessException : SystemException { // Creates a new MemberAccessException with its message string set to diff --git a/src/mscorlib/shared/System/MethodAccessException.cs b/src/mscorlib/shared/System/MethodAccessException.cs index 2ecbd14d6d20..515458cb165d 100644 --- a/src/mscorlib/shared/System/MethodAccessException.cs +++ b/src/mscorlib/shared/System/MethodAccessException.cs @@ -13,7 +13,6 @@ namespace System { - [Serializable] public class MethodAccessException : MemberAccessException { public MethodAccessException() diff --git a/src/mscorlib/shared/System/MissingMethodException.cs b/src/mscorlib/shared/System/MissingMethodException.cs index 07d428967b5e..2bb92e1a557b 100644 --- a/src/mscorlib/shared/System/MissingMethodException.cs +++ b/src/mscorlib/shared/System/MissingMethodException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public class MissingMethodException : MissingMemberException { public MissingMethodException() diff --git a/src/mscorlib/shared/System/MulticastNotSupportedException.cs b/src/mscorlib/shared/System/MulticastNotSupportedException.cs index 4fcaa9857d75..5b1f41e69da4 100644 --- a/src/mscorlib/shared/System/MulticastNotSupportedException.cs +++ b/src/mscorlib/shared/System/MulticastNotSupportedException.cs @@ -11,7 +11,6 @@ namespace System { - [Serializable] public sealed class MulticastNotSupportedException : SystemException { public MulticastNotSupportedException() diff --git a/src/mscorlib/shared/System/NotFiniteNumberException.cs b/src/mscorlib/shared/System/NotFiniteNumberException.cs index 5bc8df1e28f0..f14f3a357500 100644 --- a/src/mscorlib/shared/System/NotFiniteNumberException.cs +++ b/src/mscorlib/shared/System/NotFiniteNumberException.cs @@ -6,7 +6,6 @@ namespace System { - [Serializable] public class NotFiniteNumberException : ArithmeticException { private double _offendingNumber; diff --git a/src/mscorlib/shared/System/NotImplementedException.cs b/src/mscorlib/shared/System/NotImplementedException.cs index 4d141eac8c72..7d562ed08375 100644 --- a/src/mscorlib/shared/System/NotImplementedException.cs +++ b/src/mscorlib/shared/System/NotImplementedException.cs @@ -16,7 +16,6 @@ namespace System { - [Serializable] public class NotImplementedException : SystemException { public NotImplementedException() diff --git a/src/mscorlib/shared/System/NotSupportedException.cs b/src/mscorlib/shared/System/NotSupportedException.cs index 21b2d54a46aa..6d68b07e2e0b 100644 --- a/src/mscorlib/shared/System/NotSupportedException.cs +++ b/src/mscorlib/shared/System/NotSupportedException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public class NotSupportedException : SystemException { public NotSupportedException() diff --git a/src/mscorlib/shared/System/NullReferenceException.cs b/src/mscorlib/shared/System/NullReferenceException.cs index 0aa5c6197a3e..fb9886805cd1 100644 --- a/src/mscorlib/shared/System/NullReferenceException.cs +++ b/src/mscorlib/shared/System/NullReferenceException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public class NullReferenceException : SystemException { public NullReferenceException() diff --git a/src/mscorlib/shared/System/ObjectDisposedException.cs b/src/mscorlib/shared/System/ObjectDisposedException.cs index abb7c89dae69..abeefca5986b 100644 --- a/src/mscorlib/shared/System/ObjectDisposedException.cs +++ b/src/mscorlib/shared/System/ObjectDisposedException.cs @@ -11,7 +11,6 @@ namespace System /// The exception that is thrown when accessing an object that was /// disposed. /// - [Serializable] public class ObjectDisposedException : InvalidOperationException { private String _objectName; diff --git a/src/mscorlib/shared/System/ObsoleteAttribute.cs b/src/mscorlib/shared/System/ObsoleteAttribute.cs index f1836859987a..a63db137f878 100644 --- a/src/mscorlib/shared/System/ObsoleteAttribute.cs +++ b/src/mscorlib/shared/System/ObsoleteAttribute.cs @@ -21,7 +21,6 @@ namespace System // error. (this would be used if the actual implementation of the obsolete // method's implementation had changed). // - [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Delegate , Inherited = false)] diff --git a/src/mscorlib/shared/System/OperationCanceledException.cs b/src/mscorlib/shared/System/OperationCanceledException.cs index 826561776f8b..cd1f3285b633 100644 --- a/src/mscorlib/shared/System/OperationCanceledException.cs +++ b/src/mscorlib/shared/System/OperationCanceledException.cs @@ -17,7 +17,6 @@ namespace System { - [Serializable] public class OperationCanceledException : SystemException { [NonSerialized] diff --git a/src/mscorlib/shared/System/OverflowException.cs b/src/mscorlib/shared/System/OverflowException.cs index e28c688dd6d3..d32df8b39393 100644 --- a/src/mscorlib/shared/System/OverflowException.cs +++ b/src/mscorlib/shared/System/OverflowException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public class OverflowException : ArithmeticException { public OverflowException() diff --git a/src/mscorlib/shared/System/PlatformNotSupportedException.cs b/src/mscorlib/shared/System/PlatformNotSupportedException.cs index d2370b3924ea..fa708c92141a 100644 --- a/src/mscorlib/shared/System/PlatformNotSupportedException.cs +++ b/src/mscorlib/shared/System/PlatformNotSupportedException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public class PlatformNotSupportedException : NotSupportedException { public PlatformNotSupportedException() diff --git a/src/mscorlib/shared/System/Random.cs b/src/mscorlib/shared/System/Random.cs index a66a9ea423c1..4affed8a1a0d 100644 --- a/src/mscorlib/shared/System/Random.cs +++ b/src/mscorlib/shared/System/Random.cs @@ -18,7 +18,6 @@ namespace System { - [Serializable] public class Random { // diff --git a/src/mscorlib/shared/System/RankException.cs b/src/mscorlib/shared/System/RankException.cs index 612d0f086c01..8762aa2d66f5 100644 --- a/src/mscorlib/shared/System/RankException.cs +++ b/src/mscorlib/shared/System/RankException.cs @@ -16,7 +16,6 @@ namespace System { - [Serializable] public class RankException : SystemException { public RankException() diff --git a/src/mscorlib/shared/System/Reflection/AmbiguousMatchException.cs b/src/mscorlib/shared/System/Reflection/AmbiguousMatchException.cs index 459a19cb71fc..4e14e1f1ba36 100644 --- a/src/mscorlib/shared/System/Reflection/AmbiguousMatchException.cs +++ b/src/mscorlib/shared/System/Reflection/AmbiguousMatchException.cs @@ -6,7 +6,6 @@ namespace System.Reflection { - [Serializable] public sealed class AmbiguousMatchException : SystemException { public AmbiguousMatchException() diff --git a/src/mscorlib/shared/System/Reflection/CustomAttributeFormatException.cs b/src/mscorlib/shared/System/Reflection/CustomAttributeFormatException.cs index 6e115405052d..29bf7f099e08 100644 --- a/src/mscorlib/shared/System/Reflection/CustomAttributeFormatException.cs +++ b/src/mscorlib/shared/System/Reflection/CustomAttributeFormatException.cs @@ -6,7 +6,6 @@ namespace System.Reflection { - [Serializable] public class CustomAttributeFormatException : FormatException { public CustomAttributeFormatException() diff --git a/src/mscorlib/shared/System/Reflection/DefaultMemberAttribute.cs b/src/mscorlib/shared/System/Reflection/DefaultMemberAttribute.cs index 351143371333..585fdb07cd0f 100644 --- a/src/mscorlib/shared/System/Reflection/DefaultMemberAttribute.cs +++ b/src/mscorlib/shared/System/Reflection/DefaultMemberAttribute.cs @@ -4,7 +4,6 @@ namespace System.Reflection { - [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface)] public sealed class DefaultMemberAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Reflection/InvalidFilterCriteriaException.cs b/src/mscorlib/shared/System/Reflection/InvalidFilterCriteriaException.cs index e3f882c409d2..c7644b8a8201 100644 --- a/src/mscorlib/shared/System/Reflection/InvalidFilterCriteriaException.cs +++ b/src/mscorlib/shared/System/Reflection/InvalidFilterCriteriaException.cs @@ -6,7 +6,6 @@ namespace System.Reflection { - [Serializable] public class InvalidFilterCriteriaException : ApplicationException { public InvalidFilterCriteriaException() diff --git a/src/mscorlib/shared/System/Reflection/MemberInfoSerializationHolder.cs b/src/mscorlib/shared/System/Reflection/MemberInfoSerializationHolder.cs index dfc56667bd2c..ee14ab2ca311 100644 --- a/src/mscorlib/shared/System/Reflection/MemberInfoSerializationHolder.cs +++ b/src/mscorlib/shared/System/Reflection/MemberInfoSerializationHolder.cs @@ -9,7 +9,6 @@ namespace System.Reflection { - [Serializable] #if CORECLR internal #else diff --git a/src/mscorlib/shared/System/Reflection/Missing.cs b/src/mscorlib/shared/System/Reflection/Missing.cs index fa32d43ccb2c..17829104094d 100644 --- a/src/mscorlib/shared/System/Reflection/Missing.cs +++ b/src/mscorlib/shared/System/Reflection/Missing.cs @@ -6,7 +6,6 @@ namespace System.Reflection { - [Serializable] public sealed class Missing : ISerializable { public static readonly Missing Value = new Missing(); diff --git a/src/mscorlib/shared/System/Reflection/ParameterModifier.cs b/src/mscorlib/shared/System/Reflection/ParameterModifier.cs index 18d6cf669d54..640fee284aec 100644 --- a/src/mscorlib/shared/System/Reflection/ParameterModifier.cs +++ b/src/mscorlib/shared/System/Reflection/ParameterModifier.cs @@ -4,7 +4,6 @@ namespace System.Reflection { - [Serializable] public struct ParameterModifier { private readonly bool[] _byRef; diff --git a/src/mscorlib/shared/System/Reflection/Pointer.cs b/src/mscorlib/shared/System/Reflection/Pointer.cs index 13a5efff464b..d93e5b01440a 100644 --- a/src/mscorlib/shared/System/Reflection/Pointer.cs +++ b/src/mscorlib/shared/System/Reflection/Pointer.cs @@ -7,7 +7,6 @@ namespace System.Reflection { - [Serializable] [CLSCompliant(false)] public sealed unsafe class Pointer : ISerializable { diff --git a/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs b/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs index 772620cf84e3..1a59c20e702e 100644 --- a/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs +++ b/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs @@ -6,7 +6,6 @@ namespace System.Reflection { - [Serializable] public sealed class ReflectionTypeLoadException : SystemException, ISerializable { public ReflectionTypeLoadException(Type[] classes, Exception[] exceptions) diff --git a/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs b/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs index c04ddd6d1a1a..03fbb91bed1d 100644 --- a/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs +++ b/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs @@ -7,7 +7,6 @@ namespace System.Reflection { - [Serializable] public class StrongNameKeyPair : IDeserializationCallback, ISerializable { private bool _keyPairExported; diff --git a/src/mscorlib/shared/System/Reflection/TargetException.cs b/src/mscorlib/shared/System/Reflection/TargetException.cs index 03f8730cdd78..16b4a1455e35 100644 --- a/src/mscorlib/shared/System/Reflection/TargetException.cs +++ b/src/mscorlib/shared/System/Reflection/TargetException.cs @@ -6,7 +6,6 @@ namespace System.Reflection { - [Serializable] public class TargetException : ApplicationException { public TargetException() diff --git a/src/mscorlib/shared/System/Reflection/TargetInvocationException.cs b/src/mscorlib/shared/System/Reflection/TargetInvocationException.cs index e934e5bde70f..8c98e5c0bfba 100644 --- a/src/mscorlib/shared/System/Reflection/TargetInvocationException.cs +++ b/src/mscorlib/shared/System/Reflection/TargetInvocationException.cs @@ -6,7 +6,6 @@ namespace System.Reflection { - [Serializable] public sealed class TargetInvocationException : ApplicationException { public TargetInvocationException(Exception inner) diff --git a/src/mscorlib/shared/System/Reflection/TargetParameterCountException.cs b/src/mscorlib/shared/System/Reflection/TargetParameterCountException.cs index c3604548e6fb..befe6b2f19d3 100644 --- a/src/mscorlib/shared/System/Reflection/TargetParameterCountException.cs +++ b/src/mscorlib/shared/System/Reflection/TargetParameterCountException.cs @@ -6,7 +6,6 @@ namespace System.Reflection { - [Serializable] public sealed class TargetParameterCountException : ApplicationException { public TargetParameterCountException() diff --git a/src/mscorlib/shared/System/Reflection/TypeDelegator.cs b/src/mscorlib/shared/System/Reflection/TypeDelegator.cs index a301ddc11ea7..bcbff05d62eb 100644 --- a/src/mscorlib/shared/System/Reflection/TypeDelegator.cs +++ b/src/mscorlib/shared/System/Reflection/TypeDelegator.cs @@ -10,7 +10,6 @@ namespace System.Reflection { - [Serializable] public class TypeDelegator : TypeInfo { public override bool IsAssignableFrom(TypeInfo typeInfo) diff --git a/src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs b/src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs index 70f41f4d9ef7..ce2c4c7e83f1 100644 --- a/src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs +++ b/src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs @@ -7,7 +7,6 @@ namespace System.Resources { - [Serializable] public class MissingManifestResourceException : SystemException { public MissingManifestResourceException() diff --git a/src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs b/src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs index b343e0cfbc46..8a9289b0a547 100644 --- a/src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs +++ b/src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs @@ -20,7 +20,6 @@ namespace System.Resources { - [Serializable] public class MissingSatelliteAssemblyException : SystemException { private String _cultureName; diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs index 198ed3d0e760..66c9175ee75a 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs @@ -4,7 +4,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)] public sealed class AsyncStateMachineAttribute : StateMachineAttribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxationsAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxationsAttribute.cs index 1f100bd41527..d6da23fdf2a7 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxationsAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxationsAttribute.cs @@ -4,7 +4,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Method)] public class CompilationRelaxationsAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs index 3da2a95aebd1..1c05abd1fec4 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs @@ -4,7 +4,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.All, Inherited = true)] public sealed class CompilerGeneratedAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs index 22fa69420084..752295e87626 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs @@ -6,7 +6,6 @@ namespace System.Runtime.CompilerServices { // Attribute used to communicate to the VS7 debugger that a class should be treated as if it has global scope. - [Serializable] [AttributeUsage(AttributeTargets.Class)] public class CompilerGlobalScopeAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs index f5419d413b94..4c1f48921583 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs @@ -4,7 +4,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Assembly)] public sealed class DefaultDependencyAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs index 56f4242bb129..0fe07edc9e26 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs @@ -4,7 +4,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class DependencyAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs index baf582424188..8dc6c43126e9 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs @@ -4,7 +4,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Field)] public sealed class FixedAddressValueTypeAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs index 65653a44d97c..ea843b3daaa6 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs @@ -4,7 +4,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Property, Inherited = true)] public sealed class IndexerNameAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs index 5ac3918028c3..53afc9566438 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs @@ -4,7 +4,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)] public sealed class IteratorStateMachineAttribute : StateMachineAttribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs index 6e307e72af15..f3842ec562df 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs @@ -15,7 +15,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)] public sealed class ReferenceAssemblyAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs index 55dba0d113bb..609c5603300d 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs @@ -13,7 +13,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)] public sealed class RuntimeCompatibilityAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs index 94ed5b5c749e..e081d63e71f2 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs @@ -6,7 +6,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)] public class StateMachineAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs index 7772a1a263a1..25a8bfbc2647 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs @@ -6,7 +6,6 @@ namespace System.Runtime.CompilerServices { // Custom attribute to indicate that strings should be frozen. - [Serializable] [AttributeUsage(AttributeTargets.Assembly, Inherited = false)] public sealed class StringFreezingAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs index 162676efe8ec..f049c89b3f3e 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs @@ -4,7 +4,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Struct)] sealed public class UnsafeValueTypeAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs b/src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs index d7bde79c4301..f349a5becf04 100644 --- a/src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs +++ b/src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs @@ -21,7 +21,6 @@ namespace System.Runtime.InteropServices // Base exception for COM Interop errors &; Structured Exception Handler // exceptions. // - [Serializable] public class ExternalException : SystemException { public ExternalException() diff --git a/src/mscorlib/shared/System/Runtime/Serialization/SerializationException.cs b/src/mscorlib/shared/System/Runtime/Serialization/SerializationException.cs index a359daf4f9e7..b11daa5a8af1 100644 --- a/src/mscorlib/shared/System/Runtime/Serialization/SerializationException.cs +++ b/src/mscorlib/shared/System/Runtime/Serialization/SerializationException.cs @@ -6,7 +6,6 @@ namespace System.Runtime.Serialization { - [Serializable] public class SerializationException : SystemException { private static String s_nullMessage = SR.SerializationException; diff --git a/src/mscorlib/shared/System/Runtime/Serialization/StreamingContext.cs b/src/mscorlib/shared/System/Runtime/Serialization/StreamingContext.cs index 1026a87d1ea9..4fe90cad8dae 100644 --- a/src/mscorlib/shared/System/Runtime/Serialization/StreamingContext.cs +++ b/src/mscorlib/shared/System/Runtime/Serialization/StreamingContext.cs @@ -4,7 +4,6 @@ namespace System.Runtime.Serialization { - [Serializable] public struct StreamingContext { private readonly object _additionalContext; diff --git a/src/mscorlib/shared/System/Security/CryptographicException.cs b/src/mscorlib/shared/System/Security/CryptographicException.cs index 89cb658aa9ca..62613c98b7a6 100644 --- a/src/mscorlib/shared/System/Security/CryptographicException.cs +++ b/src/mscorlib/shared/System/Security/CryptographicException.cs @@ -7,7 +7,6 @@ namespace System.Security.Cryptography { - [Serializable] public class CryptographicException : SystemException { public CryptographicException() diff --git a/src/mscorlib/shared/System/Security/SecurityException.cs b/src/mscorlib/shared/System/Security/SecurityException.cs index 86e3cd463181..6baba64efd97 100644 --- a/src/mscorlib/shared/System/Security/SecurityException.cs +++ b/src/mscorlib/shared/System/Security/SecurityException.cs @@ -7,7 +7,6 @@ namespace System.Security { - [Serializable] public class SecurityException : SystemException { public SecurityException() diff --git a/src/mscorlib/shared/System/Security/VerificationException.cs b/src/mscorlib/shared/System/Security/VerificationException.cs index 9641e1aa465a..5a93b358005a 100644 --- a/src/mscorlib/shared/System/Security/VerificationException.cs +++ b/src/mscorlib/shared/System/Security/VerificationException.cs @@ -6,7 +6,6 @@ namespace System.Security { - [Serializable] public class VerificationException : SystemException { public VerificationException() diff --git a/src/mscorlib/shared/System/StackOverflowException.cs b/src/mscorlib/shared/System/StackOverflowException.cs index 0a875e7373fa..2975253ebd7c 100644 --- a/src/mscorlib/shared/System/StackOverflowException.cs +++ b/src/mscorlib/shared/System/StackOverflowException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public sealed class StackOverflowException : SystemException { public StackOverflowException() diff --git a/src/mscorlib/shared/System/SystemException.cs b/src/mscorlib/shared/System/SystemException.cs index f4779a2cd487..9961df39c61a 100644 --- a/src/mscorlib/shared/System/SystemException.cs +++ b/src/mscorlib/shared/System/SystemException.cs @@ -6,7 +6,6 @@ namespace System { - [Serializable] public class SystemException : Exception { public SystemException() diff --git a/src/mscorlib/shared/System/Text/ASCIIEncoding.cs b/src/mscorlib/shared/System/Text/ASCIIEncoding.cs index e5c11948490e..628ec9a3fa36 100644 --- a/src/mscorlib/shared/System/Text/ASCIIEncoding.cs +++ b/src/mscorlib/shared/System/Text/ASCIIEncoding.cs @@ -19,11 +19,9 @@ namespace System.Text // Note: IsAlwaysNormalized remains false because 1/2 the code points are unassigned, so they'd // use fallbacks, and we cannot guarantee that fallbacks are normalized. - [Serializable] public class ASCIIEncoding : Encoding { // Allow for devirtualization (see https://github.com/dotnet/coreclr/pull/9230) - [Serializable] internal sealed class ASCIIEncodingSealed : ASCIIEncoding { } // Used by Encoding.ASCII for lazy initialization diff --git a/src/mscorlib/shared/System/Text/Decoder.cs b/src/mscorlib/shared/System/Text/Decoder.cs index b2a003037b8d..aefe1f64bda8 100644 --- a/src/mscorlib/shared/System/Text/Decoder.cs +++ b/src/mscorlib/shared/System/Text/Decoder.cs @@ -21,7 +21,6 @@ namespace System.Text // class are typically obtained through calls to the GetDecoder method // of Encoding objects. // - [Serializable] public abstract class Decoder { internal DecoderFallback m_fallback = null; diff --git a/src/mscorlib/shared/System/Text/Encoder.cs b/src/mscorlib/shared/System/Text/Encoder.cs index e4e91765e123..c4b54ce75c6b 100644 --- a/src/mscorlib/shared/System/Text/Encoder.cs +++ b/src/mscorlib/shared/System/Text/Encoder.cs @@ -21,7 +21,6 @@ namespace System.Text // class are typically obtained through calls to the GetEncoder method // of Encoding objects. // - [Serializable] public abstract class Encoder { internal EncoderFallback m_fallback = null; diff --git a/src/mscorlib/shared/System/Text/EncodingInfo.cs b/src/mscorlib/shared/System/Text/EncodingInfo.cs index 360dd7f638b3..99995f759b20 100644 --- a/src/mscorlib/shared/System/Text/EncodingInfo.cs +++ b/src/mscorlib/shared/System/Text/EncodingInfo.cs @@ -7,7 +7,6 @@ namespace System.Text { - [Serializable] public sealed class EncodingInfo { private int iCodePage; // Code Page # diff --git a/src/mscorlib/shared/System/Text/EncodingNLS.cs b/src/mscorlib/shared/System/Text/EncodingNLS.cs index 205ae269029c..835bf8fb372d 100644 --- a/src/mscorlib/shared/System/Text/EncodingNLS.cs +++ b/src/mscorlib/shared/System/Text/EncodingNLS.cs @@ -23,7 +23,6 @@ namespace System.Text // So if you change the wrappers in this class, you must change the wrappers in the other classes // as well because they should have the same behavior. - [Serializable] internal abstract class EncodingNLS : Encoding { protected EncodingNLS(int codePage) : base(codePage) diff --git a/src/mscorlib/shared/System/Text/UTF32Encoding.cs b/src/mscorlib/shared/System/Text/UTF32Encoding.cs index e4cd6c960e4d..450aee2a4ac5 100644 --- a/src/mscorlib/shared/System/Text/UTF32Encoding.cs +++ b/src/mscorlib/shared/System/Text/UTF32Encoding.cs @@ -21,7 +21,6 @@ namespace System.Text // mark is used mostly to distinguish UTF-32 text from other encodings, and doesn't // switch the byte orderings. - [Serializable] public sealed class UTF32Encoding : Encoding { /* @@ -1200,7 +1199,6 @@ public override int GetHashCode() CodePage + (_emitUTF32ByteOrderMark ? 4 : 0) + (_bigEndian ? 8 : 0); } - [Serializable] private sealed class UTF32Decoder : DecoderNLS { // Need a place to store any extra bytes we may have picked up diff --git a/src/mscorlib/shared/System/Text/UTF8Encoding.cs b/src/mscorlib/shared/System/Text/UTF8Encoding.cs index 5cfa89018a23..e91b889cb13c 100644 --- a/src/mscorlib/shared/System/Text/UTF8Encoding.cs +++ b/src/mscorlib/shared/System/Text/UTF8Encoding.cs @@ -34,7 +34,6 @@ namespace System.Text // used mostly to distinguish UTF-8 text from other encodings, and doesn't // switch the byte orderings. - [Serializable] public class UTF8Encoding : Encoding { /* @@ -53,7 +52,6 @@ 4 21 11110vvv 10vvvvvv 10vvvvvv 10vvvvvv private const int UTF8_CODEPAGE = 65001; // Allow for devirtualization (see https://github.com/dotnet/coreclr/pull/9230) - [Serializable] internal sealed class UTF8EncodingSealed : UTF8Encoding { public UTF8EncodingSealed(bool encoderShouldEmitUTF8Identifier) : base(encoderShouldEmitUTF8Identifier) { } @@ -2521,7 +2519,6 @@ public override int GetHashCode() UTF8_CODEPAGE + (_emitUTF8Identifier ? 1 : 0); } - [Serializable] private sealed class UTF8Encoder : EncoderNLS, ISerializable { // We must save a high surrogate value until the next call, looking @@ -2593,7 +2590,6 @@ internal override bool HasState } } - [Serializable] private sealed class UTF8Decoder : DecoderNLS, ISerializable { // We'll need to remember the previous information. See the comments around definition diff --git a/src/mscorlib/shared/System/Text/UnicodeEncoding.cs b/src/mscorlib/shared/System/Text/UnicodeEncoding.cs index 0e4db9aaadad..1b60b5b614c4 100644 --- a/src/mscorlib/shared/System/Text/UnicodeEncoding.cs +++ b/src/mscorlib/shared/System/Text/UnicodeEncoding.cs @@ -14,7 +14,6 @@ namespace System.Text { - [Serializable] public class UnicodeEncoding : Encoding { // Used by Encoding.BigEndianUnicode/Unicode for lazy initialization @@ -1983,7 +1982,6 @@ public override int GetHashCode() (byteOrderMark ? 4 : 0) + (bigEndian ? 8 : 0); } - [Serializable] private sealed class Decoder : System.Text.DecoderNLS, ISerializable { internal int lastByte = -1; diff --git a/src/mscorlib/shared/System/ThreadStaticAttribute.cs b/src/mscorlib/shared/System/ThreadStaticAttribute.cs index 3755e65a7b2b..c12ac1c18da2 100644 --- a/src/mscorlib/shared/System/ThreadStaticAttribute.cs +++ b/src/mscorlib/shared/System/ThreadStaticAttribute.cs @@ -17,7 +17,6 @@ namespace System { - [Serializable] [AttributeUsage(AttributeTargets.Field, Inherited = false)] public class ThreadStaticAttribute : Attribute { diff --git a/src/mscorlib/shared/System/Threading/AbandonedMutexException.cs b/src/mscorlib/shared/System/Threading/AbandonedMutexException.cs index 8056a3b330f5..7a0169f3ec10 100644 --- a/src/mscorlib/shared/System/Threading/AbandonedMutexException.cs +++ b/src/mscorlib/shared/System/Threading/AbandonedMutexException.cs @@ -14,7 +14,6 @@ namespace System.Threading { - [Serializable] public class AbandonedMutexException : SystemException { private int _mutexIndex = -1; diff --git a/src/mscorlib/shared/System/Threading/ExecutionContext.cs b/src/mscorlib/shared/System/Threading/ExecutionContext.cs index 67857e9b115e..b2cd71b27761 100644 --- a/src/mscorlib/shared/System/Threading/ExecutionContext.cs +++ b/src/mscorlib/shared/System/Threading/ExecutionContext.cs @@ -44,7 +44,6 @@ internal void Undo(Thread currentThread) } } - [Serializable] public sealed class ExecutionContext : IDisposable, ISerializable { internal static readonly ExecutionContext Default = new ExecutionContext(); diff --git a/src/mscorlib/shared/System/Threading/LockRecursionException.cs b/src/mscorlib/shared/System/Threading/LockRecursionException.cs index 2f296cb14e74..a9f0c5641466 100644 --- a/src/mscorlib/shared/System/Threading/LockRecursionException.cs +++ b/src/mscorlib/shared/System/Threading/LockRecursionException.cs @@ -7,7 +7,6 @@ namespace System.Threading { - [Serializable] public class LockRecursionException : System.Exception { public LockRecursionException() diff --git a/src/mscorlib/shared/System/Threading/SemaphoreFullException.cs b/src/mscorlib/shared/System/Threading/SemaphoreFullException.cs index 19ac19d6e0cb..b583138473c1 100644 --- a/src/mscorlib/shared/System/Threading/SemaphoreFullException.cs +++ b/src/mscorlib/shared/System/Threading/SemaphoreFullException.cs @@ -7,7 +7,6 @@ namespace System.Threading { - [Serializable] public class SemaphoreFullException : SystemException { public SemaphoreFullException() : base(SR.Threading_SemaphoreFullException) diff --git a/src/mscorlib/shared/System/Threading/SynchronizationLockException.cs b/src/mscorlib/shared/System/Threading/SynchronizationLockException.cs index 120577fdcf48..e21d0c382272 100644 --- a/src/mscorlib/shared/System/Threading/SynchronizationLockException.cs +++ b/src/mscorlib/shared/System/Threading/SynchronizationLockException.cs @@ -16,7 +16,6 @@ namespace System.Threading { - [Serializable] public class SynchronizationLockException : SystemException { public SynchronizationLockException() diff --git a/src/mscorlib/shared/System/Threading/Tasks/TaskCanceledException.cs b/src/mscorlib/shared/System/Threading/Tasks/TaskCanceledException.cs index d7690d4c7cd3..ee03204a59d9 100644 --- a/src/mscorlib/shared/System/Threading/Tasks/TaskCanceledException.cs +++ b/src/mscorlib/shared/System/Threading/Tasks/TaskCanceledException.cs @@ -19,7 +19,6 @@ namespace System.Threading.Tasks /// /// Represents an exception used to communicate task cancellation. /// - [Serializable] public class TaskCanceledException : OperationCanceledException { [NonSerialized] diff --git a/src/mscorlib/shared/System/Threading/Tasks/TaskSchedulerException.cs b/src/mscorlib/shared/System/Threading/Tasks/TaskSchedulerException.cs index 148b6300efce..70e13f2c4260 100644 --- a/src/mscorlib/shared/System/Threading/Tasks/TaskSchedulerException.cs +++ b/src/mscorlib/shared/System/Threading/Tasks/TaskSchedulerException.cs @@ -20,7 +20,6 @@ namespace System.Threading.Tasks /// Represents an exception used to communicate an invalid operation by a /// . /// - [Serializable] public class TaskSchedulerException : Exception { /// diff --git a/src/mscorlib/shared/System/Threading/ThreadAbortException.cs b/src/mscorlib/shared/System/Threading/ThreadAbortException.cs index e693e7192f42..f4e2ea6bf2c1 100644 --- a/src/mscorlib/shared/System/Threading/ThreadAbortException.cs +++ b/src/mscorlib/shared/System/Threading/ThreadAbortException.cs @@ -18,7 +18,6 @@ namespace System.Threading { - [Serializable] public sealed class ThreadAbortException : SystemException { private ThreadAbortException() diff --git a/src/mscorlib/shared/System/Threading/ThreadStartException.cs b/src/mscorlib/shared/System/Threading/ThreadStartException.cs index 2ff77bc5fda9..9812de339b9e 100644 --- a/src/mscorlib/shared/System/Threading/ThreadStartException.cs +++ b/src/mscorlib/shared/System/Threading/ThreadStartException.cs @@ -6,7 +6,6 @@ namespace System.Threading { - [Serializable] public sealed class ThreadStartException : SystemException { internal ThreadStartException() diff --git a/src/mscorlib/shared/System/Threading/ThreadStateException.cs b/src/mscorlib/shared/System/Threading/ThreadStateException.cs index 33bc8baee6d0..a186acd6729c 100644 --- a/src/mscorlib/shared/System/Threading/ThreadStateException.cs +++ b/src/mscorlib/shared/System/Threading/ThreadStateException.cs @@ -16,7 +16,6 @@ namespace System.Threading { - [Serializable] public class ThreadStateException : SystemException { public ThreadStateException() diff --git a/src/mscorlib/shared/System/Threading/WaitHandleCannotBeOpenedException.cs b/src/mscorlib/shared/System/Threading/WaitHandleCannotBeOpenedException.cs index e44946a669b5..02dad478778a 100644 --- a/src/mscorlib/shared/System/Threading/WaitHandleCannotBeOpenedException.cs +++ b/src/mscorlib/shared/System/Threading/WaitHandleCannotBeOpenedException.cs @@ -6,7 +6,6 @@ namespace System.Threading { - [Serializable] public class WaitHandleCannotBeOpenedException : ApplicationException { public WaitHandleCannotBeOpenedException() : base(SR.Threading_WaitHandleCannotBeOpenedException) diff --git a/src/mscorlib/shared/System/TimeZoneNotFoundException.cs b/src/mscorlib/shared/System/TimeZoneNotFoundException.cs index ee21c2524fb2..acb1b6f19663 100644 --- a/src/mscorlib/shared/System/TimeZoneNotFoundException.cs +++ b/src/mscorlib/shared/System/TimeZoneNotFoundException.cs @@ -6,7 +6,6 @@ namespace System { - [Serializable] public class TimeZoneNotFoundException : Exception { public TimeZoneNotFoundException() diff --git a/src/mscorlib/shared/System/TimeoutException.cs b/src/mscorlib/shared/System/TimeoutException.cs index 32775a1c567c..92780a818b2e 100644 --- a/src/mscorlib/shared/System/TimeoutException.cs +++ b/src/mscorlib/shared/System/TimeoutException.cs @@ -15,7 +15,6 @@ namespace System { - [Serializable] public class TimeoutException : SystemException { public TimeoutException() diff --git a/src/mscorlib/shared/System/TypeAccessException.cs b/src/mscorlib/shared/System/TypeAccessException.cs index 32afbdfeb8be..3561abe1aea0 100644 --- a/src/mscorlib/shared/System/TypeAccessException.cs +++ b/src/mscorlib/shared/System/TypeAccessException.cs @@ -8,7 +8,6 @@ namespace System { // TypeAccessException derives from TypeLoadException rather than MemberAccessException because in // pre-v4 releases of the runtime TypeLoadException was used in lieu of a TypeAccessException. - [Serializable] public class TypeAccessException : TypeLoadException { public TypeAccessException() diff --git a/src/mscorlib/shared/System/TypeInitializationException.cs b/src/mscorlib/shared/System/TypeInitializationException.cs index 919102834693..53dd80ead2eb 100644 --- a/src/mscorlib/shared/System/TypeInitializationException.cs +++ b/src/mscorlib/shared/System/TypeInitializationException.cs @@ -19,7 +19,6 @@ namespace System { - [Serializable] public sealed class TypeInitializationException : SystemException { private String _typeName; diff --git a/src/mscorlib/shared/System/TypeUnloadedException.cs b/src/mscorlib/shared/System/TypeUnloadedException.cs index 33e46877727b..296a82065fb4 100644 --- a/src/mscorlib/shared/System/TypeUnloadedException.cs +++ b/src/mscorlib/shared/System/TypeUnloadedException.cs @@ -6,7 +6,6 @@ namespace System { - [Serializable] public class TypeUnloadedException : SystemException { public TypeUnloadedException() diff --git a/src/mscorlib/shared/System/UnauthorizedAccessException.cs b/src/mscorlib/shared/System/UnauthorizedAccessException.cs index 997358826fc0..ceb018697231 100644 --- a/src/mscorlib/shared/System/UnauthorizedAccessException.cs +++ b/src/mscorlib/shared/System/UnauthorizedAccessException.cs @@ -19,7 +19,6 @@ namespace System { // The UnauthorizedAccessException is thrown when access errors // occur from IO or other OS methods. - [Serializable] public class UnauthorizedAccessException : SystemException { public UnauthorizedAccessException() diff --git a/src/mscorlib/shared/System/UnhandledExceptionEventArgs.cs b/src/mscorlib/shared/System/UnhandledExceptionEventArgs.cs index d33830181c38..5cde57216164 100644 --- a/src/mscorlib/shared/System/UnhandledExceptionEventArgs.cs +++ b/src/mscorlib/shared/System/UnhandledExceptionEventArgs.cs @@ -4,7 +4,6 @@ namespace System { - [Serializable] public class UnhandledExceptionEventArgs : EventArgs { private Object _exception; diff --git a/src/mscorlib/shared/System/UnitySerializationHolder.cs b/src/mscorlib/shared/System/UnitySerializationHolder.cs index f1957981d357..57eed72312ca 100644 --- a/src/mscorlib/shared/System/UnitySerializationHolder.cs +++ b/src/mscorlib/shared/System/UnitySerializationHolder.cs @@ -12,7 +12,6 @@ namespace System { - [Serializable] // Holds classes (Empty, Null, Missing) for which we guarantee that there is only ever one instance of. #if CORECLR internal diff --git a/src/mscorlib/shared/System/Void.cs b/src/mscorlib/shared/System/Void.cs index 5c20f634fcc2..5162e6ad02ad 100644 --- a/src/mscorlib/shared/System/Void.cs +++ b/src/mscorlib/shared/System/Void.cs @@ -10,7 +10,6 @@ namespace System { // This class represents the void return type - [Serializable] public struct Void { } diff --git a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs index ff2c512f17f1..b05445961dd3 100644 --- a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs +++ b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs @@ -399,7 +399,6 @@ internal class SECURITY_ATTRIBUTES internal int bInheritHandle = 0; } - [Serializable] [StructLayout(LayoutKind.Sequential)] internal struct WIN32_FILE_ATTRIBUTE_DATA { @@ -723,7 +722,6 @@ internal static int MakeHRFromErrorCode(int errorCode) } // Win32 Structs in N/Direct style - [Serializable] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] [BestFitMapping(false)] internal class WIN32_FIND_DATA diff --git a/src/mscorlib/src/System/AccessViolationException.cs b/src/mscorlib/src/System/AccessViolationException.cs index 12911c1b17b4..2ca2497f43fb 100644 --- a/src/mscorlib/src/System/AccessViolationException.cs +++ b/src/mscorlib/src/System/AccessViolationException.cs @@ -16,7 +16,6 @@ namespace System { - [Serializable] public class AccessViolationException : SystemException { public AccessViolationException() diff --git a/src/mscorlib/src/System/AppDomainSetup.cs b/src/mscorlib/src/System/AppDomainSetup.cs index 83d3ac80dadc..7714da12ab0a 100644 --- a/src/mscorlib/src/System/AppDomainSetup.cs +++ b/src/mscorlib/src/System/AppDomainSetup.cs @@ -22,7 +22,6 @@ namespace System using System.Diagnostics.Contracts; using System.Collections.Generic; - [Serializable] internal sealed class AppDomainSetup { internal enum LoaderInformation diff --git a/src/mscorlib/src/System/AppDomainUnloadedException.cs b/src/mscorlib/src/System/AppDomainUnloadedException.cs index 52cbb980afe2..f2836bf375c0 100644 --- a/src/mscorlib/src/System/AppDomainUnloadedException.cs +++ b/src/mscorlib/src/System/AppDomainUnloadedException.cs @@ -16,7 +16,6 @@ namespace System { - [Serializable] internal class AppDomainUnloadedException : SystemException { public AppDomainUnloadedException() diff --git a/src/mscorlib/src/System/Array.cs b/src/mscorlib/src/System/Array.cs index 05c4804cc527..fcfeb9467595 100644 --- a/src/mscorlib/src/System/Array.cs +++ b/src/mscorlib/src/System/Array.cs @@ -2415,7 +2415,6 @@ private void InsertionSort(int lo, int hi) } } - [Serializable] private sealed class SZArrayEnumerator : IEnumerator, ICloneable { private Array _array; @@ -2461,7 +2460,6 @@ public void Reset() } } - [Serializable] private sealed class ArrayEnumerator : IEnumerator, ICloneable { private Array array; @@ -2723,7 +2721,6 @@ private void RemoveAt(int index) // This is a normal generic Enumerator for SZ arrays. It doesn't have any of the "this" stuff // that SZArrayHelper does. // - [Serializable] private sealed class SZGenericArrayEnumerator : IEnumerator { private T[] _array; diff --git a/src/mscorlib/src/System/ArraySegment.cs b/src/mscorlib/src/System/ArraySegment.cs index a18590d5d8ea..664352708dee 100644 --- a/src/mscorlib/src/System/ArraySegment.cs +++ b/src/mscorlib/src/System/ArraySegment.cs @@ -316,7 +316,6 @@ private void ThrowInvalidOperationIfDefault() } } - [Serializable] public struct Enumerator : IEnumerator { private readonly T[] _array; diff --git a/src/mscorlib/src/System/Collections/Comparer.cs b/src/mscorlib/src/System/Collections/Comparer.cs index 7f4f9f0a0714..754b44d94386 100644 --- a/src/mscorlib/src/System/Collections/Comparer.cs +++ b/src/mscorlib/src/System/Collections/Comparer.cs @@ -20,7 +20,6 @@ namespace System.Collections { - [Serializable] internal sealed class Comparer : IComparer, ISerializable { private CompareInfo m_compareInfo; diff --git a/src/mscorlib/src/System/Collections/CompatibleComparer.cs b/src/mscorlib/src/System/Collections/CompatibleComparer.cs index 1c9070718440..7dcaa4e1033b 100644 --- a/src/mscorlib/src/System/Collections/CompatibleComparer.cs +++ b/src/mscorlib/src/System/Collections/CompatibleComparer.cs @@ -8,7 +8,6 @@ namespace System.Collections { - [Serializable] internal class CompatibleComparer : IEqualityComparer { private IComparer _comparer; diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs index c6211dadd377..3540cca8cfaa 100644 --- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs +++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs @@ -20,7 +20,6 @@ namespace System.Collections.Concurrent /// [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(SystemCollectionsConcurrent_ProducerConsumerCollectionDebugView<>))] - [Serializable] internal class ConcurrentQueue : IProducerConsumerCollection, IReadOnlyCollection { // This implementation provides an unbounded, multi-producer multi-consumer queue diff --git a/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs b/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs index 63e0d47c75a4..9841bdb4bb5c 100644 --- a/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs +++ b/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs @@ -18,7 +18,6 @@ namespace System.Collections { /// This is a simple implementation of IDictionary that is empty and readonly. - [Serializable] internal sealed class EmptyReadOnlyDictionaryInternal : IDictionary { // Note that this class must be agile with respect to AppDomains. See its usage in diff --git a/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs b/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs index e313cda0fb8d..e4a4acf74e22 100644 --- a/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs +++ b/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs @@ -368,7 +368,6 @@ private static void InsertionSort(T[] keys, int lo, int hi, Comparison compar } } - [Serializable()] internal class GenericArraySortHelper : IArraySortHelper where T : IComparable diff --git a/src/mscorlib/src/System/Collections/Generic/Comparer.cs b/src/mscorlib/src/System/Collections/Generic/Comparer.cs index a9b4b3f0ddf2..644c4ee8bfa2 100644 --- a/src/mscorlib/src/System/Collections/Generic/Comparer.cs +++ b/src/mscorlib/src/System/Collections/Generic/Comparer.cs @@ -51,7 +51,6 @@ int IComparer.Compare(object x, object y) // reasons. Adding another base class (even one with no fields) // means another generic instantiation, which can be costly esp. // for value types. - [Serializable] internal sealed class GenericComparer : Comparer where T : IComparable { @@ -112,7 +111,6 @@ public override int GetHashCode() => GetType().GetHashCode(); } - [Serializable] internal sealed class ComparisonComparer : Comparer { private readonly Comparison _comparison; @@ -134,7 +132,6 @@ public override int Compare(T x, T y) // since we want to serialize as ObjectComparer for // back-compat reasons (see below). - [Serializable] internal sealed class Int32EnumComparer : Comparer, ISerializable where T : struct { public Int32EnumComparer() @@ -169,7 +166,6 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) } } - [Serializable] internal sealed class UInt32EnumComparer : Comparer, ISerializable where T : struct { public UInt32EnumComparer() @@ -200,7 +196,6 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) } } - [Serializable] internal sealed class Int64EnumComparer : Comparer, ISerializable where T : struct { public Int64EnumComparer() @@ -228,7 +223,6 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) } } - [Serializable] internal sealed class UInt64EnumComparer : Comparer, ISerializable where T : struct { public UInt64EnumComparer() diff --git a/src/mscorlib/src/System/Collections/Generic/Dictionary.cs b/src/mscorlib/src/System/Collections/Generic/Dictionary.cs index c08e287e0320..cd33428ca198 100644 --- a/src/mscorlib/src/System/Collections/Generic/Dictionary.cs +++ b/src/mscorlib/src/System/Collections/Generic/Dictionary.cs @@ -908,7 +908,6 @@ void IDictionary.Remove(object key) } } - [Serializable] public struct Enumerator : IEnumerator>, IDictionaryEnumerator { @@ -1037,7 +1036,6 @@ object IDictionaryEnumerator.Value [DebuggerTypeProxy(typeof(Mscorlib_DictionaryKeyCollectionDebugView<,>))] [DebuggerDisplay("Count = {Count}")] - [Serializable] public sealed class KeyCollection : ICollection, ICollection, IReadOnlyCollection { private Dictionary dictionary; @@ -1188,7 +1186,6 @@ Object ICollection.SyncRoot get { return ((ICollection)dictionary).SyncRoot; } } - [Serializable] public struct Enumerator : IEnumerator, System.Collections.IEnumerator { private Dictionary dictionary; @@ -1267,7 +1264,6 @@ void System.Collections.IEnumerator.Reset() [DebuggerTypeProxy(typeof(Mscorlib_DictionaryValueCollectionDebugView<,>))] [DebuggerDisplay("Count = {Count}")] - [Serializable] public sealed class ValueCollection : ICollection, ICollection, IReadOnlyCollection { private Dictionary dictionary; @@ -1416,7 +1412,6 @@ Object ICollection.SyncRoot get { return ((ICollection)dictionary).SyncRoot; } } - [Serializable] public struct Enumerator : IEnumerator, System.Collections.IEnumerator { private Dictionary dictionary; diff --git a/src/mscorlib/src/System/Collections/Generic/List.cs b/src/mscorlib/src/System/Collections/Generic/List.cs index 4e480885efec..94e794cfd25d 100644 --- a/src/mscorlib/src/System/Collections/Generic/List.cs +++ b/src/mscorlib/src/System/Collections/Generic/List.cs @@ -1254,7 +1254,6 @@ private void AddEnumerable(IEnumerable enumerable) } } - [Serializable] public struct Enumerator : IEnumerator, System.Collections.IEnumerator { private List list; diff --git a/src/mscorlib/src/System/Collections/Hashtable.cs b/src/mscorlib/src/System/Collections/Hashtable.cs index e2fd57ea4d8d..033afe1eef43 100644 --- a/src/mscorlib/src/System/Collections/Hashtable.cs +++ b/src/mscorlib/src/System/Collections/Hashtable.cs @@ -66,7 +66,6 @@ namespace System.Collections // [DebuggerTypeProxy(typeof(System.Collections.Hashtable.HashtableDebugView))] [DebuggerDisplay("Count = {Count}")] - [Serializable] internal class Hashtable : IDictionary, ISerializable, IDeserializationCallback, ICloneable { /* @@ -1073,7 +1072,6 @@ public virtual void OnDeserialization(Object sender) // Implements a Collection for the keys of a hashtable. An instance of this // class is created by the GetKeys method of a hashtable. - [Serializable] private class KeyCollection : ICollection { private Hashtable _hashtable; @@ -1120,7 +1118,6 @@ public virtual int Count // Implements a Collection for the values of a hashtable. An instance of // this class is created by the GetValues method of a hashtable. - [Serializable] private class ValueCollection : ICollection { private Hashtable _hashtable; @@ -1166,7 +1163,6 @@ public virtual int Count } // Synchronized wrapper for hashtable - [Serializable] private class SyncHashtable : Hashtable, IEnumerable { protected Hashtable _table; @@ -1347,7 +1343,6 @@ public override void OnDeserialization(Object sender) // Implements an enumerator for a hashtable. The enumerator uses the // internal version number of the hashtabke to ensure that no modifications // are made to the hashtable while an enumeration is in progress. - [Serializable] private class HashtableEnumerator : IDictionaryEnumerator, ICloneable { private Hashtable hashtable; diff --git a/src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs b/src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs index ebf86cdc58ee..3fd0cf8c6c46 100644 --- a/src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs +++ b/src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs @@ -19,7 +19,6 @@ namespace System.Collections.ObjectModel { - [Serializable] [DebuggerTypeProxy(typeof(Mscorlib_DictionaryDebugView<,>))] [DebuggerDisplay("Count = {Count}")] internal class ReadOnlyDictionary : IDictionary, IDictionary, IReadOnlyDictionary @@ -365,7 +364,6 @@ object ICollection.SyncRoot } } - [Serializable] private struct DictionaryEnumerator : IDictionaryEnumerator { private readonly IDictionary m_dictionary; @@ -432,7 +430,6 @@ IEnumerable IReadOnlyDictionary.Values [DebuggerTypeProxy(typeof(Mscorlib_CollectionDebugView<>))] [DebuggerDisplay("Count = {Count}")] - [Serializable] public sealed class KeyCollection : ICollection, ICollection, IReadOnlyCollection { private readonly ICollection m_collection; @@ -543,7 +540,6 @@ object ICollection.SyncRoot [DebuggerTypeProxy(typeof(Mscorlib_CollectionDebugView<>))] [DebuggerDisplay("Count = {Count}")] - [Serializable] public sealed class ValueCollection : ICollection, ICollection, IReadOnlyCollection { private readonly ICollection m_collection; diff --git a/src/mscorlib/src/System/Currency.cs b/src/mscorlib/src/System/Currency.cs index 13ec1b0c4ebc..4b735bbfe340 100644 --- a/src/mscorlib/src/System/Currency.cs +++ b/src/mscorlib/src/System/Currency.cs @@ -10,7 +10,6 @@ namespace System { - [Serializable] internal struct Currency { internal long m_value; diff --git a/src/mscorlib/src/System/Delegate.cs b/src/mscorlib/src/System/Delegate.cs index 75ec57a00324..8c4516a932ae 100644 --- a/src/mscorlib/src/System/Delegate.cs +++ b/src/mscorlib/src/System/Delegate.cs @@ -15,7 +15,6 @@ namespace System using System.Diagnostics; using System.Diagnostics.Contracts; - [Serializable] [ClassInterface(ClassInterfaceType.AutoDual)] [System.Runtime.InteropServices.ComVisible(true)] public abstract class Delegate : ICloneable, ISerializable diff --git a/src/mscorlib/src/System/DelegateSerializationHolder.cs b/src/mscorlib/src/System/DelegateSerializationHolder.cs deleted file mode 100644 index 17e2dd9be207..000000000000 --- a/src/mscorlib/src/System/DelegateSerializationHolder.cs +++ /dev/null @@ -1,286 +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. - - -using System; -using System.Reflection; -using System.Runtime.Serialization; -using System.Globalization; -using System.Diagnostics.Contracts; - -namespace System -{ - [Serializable] - internal sealed class DelegateSerializationHolder : IObjectReference, ISerializable - { - #region Static Members - internal static DelegateEntry GetDelegateSerializationInfo( - SerializationInfo info, Type delegateType, Object target, MethodInfo method, int targetIndex) - { - // Used for MulticastDelegate - - if (method == null) - throw new ArgumentNullException(nameof(method)); - Contract.EndContractBlock(); - - Type c = delegateType.BaseType; - - if (c == null || (c != typeof(Delegate) && c != typeof(MulticastDelegate))) - throw new ArgumentException(SR.Arg_MustBeDelegate, "type"); - - if (method.DeclaringType == null) - throw new NotSupportedException(SR.NotSupported_GlobalMethodSerialization); - - DelegateEntry de = new DelegateEntry(delegateType.FullName, delegateType.Module.Assembly.FullName, target, - method.ReflectedType.Module.Assembly.FullName, method.ReflectedType.FullName, method.Name); - - if (info.MemberCount == 0) - { - info.SetType(typeof(DelegateSerializationHolder)); - info.AddValue("Delegate", de, typeof(DelegateEntry)); - } - - // target can be an object so it needs to be added to the info, or else a fixup is needed - // when deserializing, and the fixup will occur too late. If it is added directly to the - // info then the rules of deserialization will guarantee that it will be available when - // needed - - if (target != null) - { - String targetName = "target" + targetIndex; - info.AddValue(targetName, de.target); - de.target = targetName; - } - - // Due to a number of additions (delegate signature binding relaxation, delegates with open this or closed over the - // first parameter and delegates over generic methods) we need to send a deal more information than previously. We can - // get this by serializing the target MethodInfo. We still need to send the same information as before though (the - // DelegateEntry above) for backwards compatibility. And we want to send the MethodInfo (which is serialized via an - // ISerializable holder) as a top-level child of the info for the same reason as the target above -- we wouldn't have an - // order of deserialization guarantee otherwise. - String methodInfoName = "method" + targetIndex; - info.AddValue(methodInfoName, method); - - return de; - } - #endregion - - #region Definitions - [Serializable] - internal class DelegateEntry - { - #region Internal Data Members - internal String type; - internal String assembly; - internal Object target; - internal String targetTypeAssembly; - internal String targetTypeName; - internal String methodName; - internal DelegateEntry delegateEntry; - #endregion - - #region Constructor - internal DelegateEntry( - String type, String assembly, Object target, String targetTypeAssembly, String targetTypeName, String methodName) - { - this.type = type; - this.assembly = assembly; - this.target = target; - this.targetTypeAssembly = targetTypeAssembly; - this.targetTypeName = targetTypeName; - this.methodName = methodName; - } - #endregion - - #region Internal Members - internal DelegateEntry Entry - { - get { return delegateEntry; } - set { delegateEntry = value; } - } - #endregion - } - - #endregion - - #region Private Data Members - private DelegateEntry m_delegateEntry; - private MethodInfo[] m_methods; - #endregion - - #region Constructor - private DelegateSerializationHolder(SerializationInfo info, StreamingContext context) - { - if (info == null) - throw new ArgumentNullException(nameof(info)); - Contract.EndContractBlock(); - - bool bNewWire = true; - - try - { - m_delegateEntry = (DelegateEntry)info.GetValue("Delegate", typeof(DelegateEntry)); - } - catch - { - // Old wire format - m_delegateEntry = OldDelegateWireFormat(info, context); - bNewWire = false; - } - - if (bNewWire) - { - // retrieve the targets - DelegateEntry deiter = m_delegateEntry; - int count = 0; - while (deiter != null) - { - if (deiter.target != null) - { - string stringTarget = deiter.target as string; //need test to pass older wire format - if (stringTarget != null) - deiter.target = info.GetValue(stringTarget, typeof(Object)); - } - count++; - deiter = deiter.delegateEntry; - } - - // If the sender is as recent as us they'll have provided MethodInfos for each delegate. Look for these and pack - // them into an ordered array if present. - MethodInfo[] methods = new MethodInfo[count]; - int i; - for (i = 0; i < count; i++) - { - String methodInfoName = "method" + i; - methods[i] = (MethodInfo)info.GetValueNoThrow(methodInfoName, typeof(MethodInfo)); - if (methods[i] == null) - break; - } - - // If we got the info then make the array available for deserialization. - if (i == count) - m_methods = methods; - } - } - #endregion - - #region Private Members - private void ThrowInsufficientState(string field) - { - throw new SerializationException( - SR.Format(SR.Serialization_InsufficientDeserializationState, field)); - } - - private DelegateEntry OldDelegateWireFormat(SerializationInfo info, StreamingContext context) - { - if (info == null) - throw new ArgumentNullException(nameof(info)); - Contract.EndContractBlock(); - - String delegateType = info.GetString("DelegateType"); - String delegateAssembly = info.GetString("DelegateAssembly"); - Object target = info.GetValue("Target", typeof(Object)); - String targetTypeAssembly = info.GetString("TargetTypeAssembly"); - String targetTypeName = info.GetString("TargetTypeName"); - String methodName = info.GetString("MethodName"); - - return new DelegateEntry(delegateType, delegateAssembly, target, targetTypeAssembly, targetTypeName, methodName); - } - - private Delegate GetDelegate(DelegateEntry de, int index) - { - Delegate d; - - try - { - if (de.methodName == null || de.methodName.Length == 0) - ThrowInsufficientState("MethodName"); - - if (de.assembly == null || de.assembly.Length == 0) - ThrowInsufficientState("DelegateAssembly"); - - if (de.targetTypeName == null || de.targetTypeName.Length == 0) - ThrowInsufficientState("TargetTypeName"); - - // We cannot use Type.GetType directly, because of AppCompat - assembly names starting with '[' would fail to load. - RuntimeType type = (RuntimeType)Assembly.GetType_Compat(de.assembly, de.type); - - // {de.targetTypeAssembly, de.targetTypeName} do not actually refer to the type of the target, but the reflected - // type of the method. Those types may be the same when the method is on the target's type or on a type in its - // inheritance chain, but those types may not be the same when the method is an extension method for the - // target's type or a type in its inheritance chain. - - // If we received the new style delegate encoding we already have the target MethodInfo in hand. - if (m_methods != null) - { - // The method info is serialized, so the target type info is redundant. The desktop framework does no - // additional verification on the target type info. - d = Delegate.CreateDelegateNoSecurityCheck(type, de.target, m_methods[index]); - } - else - { - if (de.target != null) - { - // For consistency with the desktop framework, when the method info is not serialized for a closed - // delegate, the method is assumed to be on the target's type or in its inheritance chain. An extension - // method would not work on this path for the above reason and also because the delegate binds to - // instance methods only. The desktop framework does no additional verification on the target type info. - d = Delegate.CreateDelegate(type, de.target, de.methodName); - } - else - { - RuntimeType targetType = (RuntimeType)Assembly.GetType_Compat(de.targetTypeAssembly, de.targetTypeName); - d = Delegate.CreateDelegate(type, targetType, de.methodName); - } - } - } - catch (Exception e) - { - if (e is SerializationException) - throw e; - - throw new SerializationException(e.Message, e); - } - - return d; - } - #endregion - - #region IObjectReference - public Object GetRealObject(StreamingContext context) - { - int count = 0; - for (DelegateEntry de = m_delegateEntry; de != null; de = de.Entry) - count++; - - int maxindex = count - 1; - - if (count == 1) - { - return GetDelegate(m_delegateEntry, 0); - } - else - { - object[] invocationList = new object[count]; - - for (DelegateEntry de = m_delegateEntry; de != null; de = de.Entry) - { - // Be careful to match the index we pass to GetDelegate (used to look up extra information for each delegate) to - // the order we process the entries: we're actually looking at them in reverse order. - --count; - invocationList[count] = GetDelegate(de, maxindex - count); - } - return ((MulticastDelegate)invocationList[0]).NewMulticastDelegate(invocationList, invocationList.Length); - } - } - #endregion - - #region ISerializable - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - throw new NotSupportedException(SR.NotSupported_DelegateSerHolderSerial); - } - #endregion - } -} diff --git a/src/mscorlib/src/System/Diagnostics/AssertFilter.cs b/src/mscorlib/src/System/Diagnostics/AssertFilter.cs index 7c861de58ec4..39ce93ff510f 100644 --- a/src/mscorlib/src/System/Diagnostics/AssertFilter.cs +++ b/src/mscorlib/src/System/Diagnostics/AssertFilter.cs @@ -15,7 +15,6 @@ namespace System.Diagnostics // // The default filter brings up a simple Win32 dialog with 3 buttons. - [Serializable] abstract internal class AssertFilter { // Called when an assert fails. This should be overridden with logic which diff --git a/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs b/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs index 09d1e6baca55..c5b5ab4191e8 100644 --- a/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs +++ b/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs @@ -186,7 +186,6 @@ public void SetUnwind() } } - [Serializable] [SuppressMessage("Microsoft.Design", "CA1064:ExceptionsShouldBePublic")] internal sealed class ContractException : Exception { diff --git a/src/mscorlib/src/System/Diagnostics/DebuggerAttributes.cs b/src/mscorlib/src/System/Diagnostics/DebuggerAttributes.cs index 5e1dfd82a510..34e65bcb3e34 100644 --- a/src/mscorlib/src/System/Diagnostics/DebuggerAttributes.cs +++ b/src/mscorlib/src/System/Diagnostics/DebuggerAttributes.cs @@ -18,21 +18,18 @@ namespace System.Diagnostics { - [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] public sealed class DebuggerStepThroughAttribute : Attribute { public DebuggerStepThroughAttribute() { } } - [Serializable] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor, Inherited = false)] public sealed class DebuggerHiddenAttribute : Attribute { public DebuggerHiddenAttribute() { } } - [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor | AttributeTargets.Struct, Inherited = false)] public sealed class DebuggerNonUserCodeAttribute : Attribute { diff --git a/src/mscorlib/src/System/Diagnostics/EditAndContinueHelper.cs b/src/mscorlib/src/System/Diagnostics/EditAndContinueHelper.cs index 8ad4fec082a2..6b8c150ab827 100644 --- a/src/mscorlib/src/System/Diagnostics/EditAndContinueHelper.cs +++ b/src/mscorlib/src/System/Diagnostics/EditAndContinueHelper.cs @@ -16,7 +16,6 @@ namespace System.Diagnostics { - [Serializable] internal sealed class EditAndContinueHelper { #pragma warning disable 169 diff --git a/src/mscorlib/src/System/Diagnostics/LogSwitch.cs b/src/mscorlib/src/System/Diagnostics/LogSwitch.cs index 29d6a1d4e606..d3994d48b850 100644 --- a/src/mscorlib/src/System/Diagnostics/LogSwitch.cs +++ b/src/mscorlib/src/System/Diagnostics/LogSwitch.cs @@ -11,7 +11,6 @@ namespace System.Diagnostics { - [Serializable] internal class LogSwitch { // ! WARNING ! diff --git a/src/mscorlib/src/System/Diagnostics/Stackframe.cs b/src/mscorlib/src/System/Diagnostics/Stackframe.cs index b555a609e7a4..a6a7067af347 100644 --- a/src/mscorlib/src/System/Diagnostics/Stackframe.cs +++ b/src/mscorlib/src/System/Diagnostics/Stackframe.cs @@ -12,7 +12,6 @@ namespace System.Diagnostics { // There is no good reason for the methods of this class to be virtual. - [Serializable] public class StackFrame { private MethodBase method; diff --git a/src/mscorlib/src/System/Diagnostics/Stacktrace.cs b/src/mscorlib/src/System/Diagnostics/Stacktrace.cs index cdedb66ed8ba..6a138de32752 100644 --- a/src/mscorlib/src/System/Diagnostics/Stacktrace.cs +++ b/src/mscorlib/src/System/Diagnostics/Stacktrace.cs @@ -22,7 +22,6 @@ namespace System.Diagnostics // Modifying the order or fields of this object may require other changes // to the unmanaged definition of the StackFrameHelper class, in // VM\DebugDebugger.h. The binder will catch some of these layout problems. - [Serializable] internal class StackFrameHelper : IDisposable { [NonSerialized] @@ -251,7 +250,6 @@ private void OnDeserialized(StreamingContext context) // In order to ensure trusted code can trust the data it gets from a // StackTrace, we use an InheritanceDemand to prevent partially-trusted // subclasses. - [Serializable] public class StackTrace { private StackFrame[] frames; diff --git a/src/mscorlib/src/System/Empty.cs b/src/mscorlib/src/System/Empty.cs index 7c4503ef296c..10fc697ccffd 100644 --- a/src/mscorlib/src/System/Empty.cs +++ b/src/mscorlib/src/System/Empty.cs @@ -13,7 +13,6 @@ namespace System { - [Serializable] internal sealed class Empty : ISerializable { private Empty() diff --git a/src/mscorlib/src/System/Globalization/Calendar.cs b/src/mscorlib/src/System/Globalization/Calendar.cs index c23e1088c1e6..86782c1f3b0f 100644 --- a/src/mscorlib/src/System/Globalization/Calendar.cs +++ b/src/mscorlib/src/System/Globalization/Calendar.cs @@ -28,7 +28,6 @@ namespace System.Globalization // The calculation of hour/minute/second is moved to Calendar from GregorianCalendar, // since most of the calendars (or all?) have the same way of calcuating hour/minute/second. - [Serializable] public abstract partial class Calendar : ICloneable { // Number of 100ns (10E-7 second) ticks per time unit diff --git a/src/mscorlib/src/System/Globalization/CultureInfo.cs b/src/mscorlib/src/System/Globalization/CultureInfo.cs index 60938defac35..16e2d291a1a3 100644 --- a/src/mscorlib/src/System/Globalization/CultureInfo.cs +++ b/src/mscorlib/src/System/Globalization/CultureInfo.cs @@ -44,7 +44,6 @@ namespace System.Globalization using StringLcidDictionary = LowLevelDictionary; #endif - [Serializable] public partial class CultureInfo : IFormatProvider, ICloneable { //--------------------------------------------------------------------// diff --git a/src/mscorlib/src/System/Globalization/EncodingDataItem.Unix.cs b/src/mscorlib/src/System/Globalization/EncodingDataItem.Unix.cs index ffb2d46a9eae..ccf9993453a0 100644 --- a/src/mscorlib/src/System/Globalization/EncodingDataItem.Unix.cs +++ b/src/mscorlib/src/System/Globalization/EncodingDataItem.Unix.cs @@ -4,7 +4,6 @@ namespace System.Globalization { - [Serializable] internal class CodePageDataItem { private readonly int _codePage; diff --git a/src/mscorlib/src/System/Globalization/EncodingDataItem.cs b/src/mscorlib/src/System/Globalization/EncodingDataItem.cs index dedcab58a7db..00081016c338 100644 --- a/src/mscorlib/src/System/Globalization/EncodingDataItem.cs +++ b/src/mscorlib/src/System/Globalization/EncodingDataItem.cs @@ -17,7 +17,6 @@ namespace System.Globalization // immediately because they don't require creating an object. Creating any of the string // names is delayed until somebody actually asks for them and the names are then cached. - [Serializable] internal class CodePageDataItem { internal int m_dataIndex; diff --git a/src/mscorlib/src/System/Globalization/GregorianCalendar.cs b/src/mscorlib/src/System/Globalization/GregorianCalendar.cs index 6dbf5b2786b3..9115b12bd061 100644 --- a/src/mscorlib/src/System/Globalization/GregorianCalendar.cs +++ b/src/mscorlib/src/System/Globalization/GregorianCalendar.cs @@ -13,9 +13,6 @@ namespace System.Globalization // This calendar recognizes two era values: // 0 CurrentEra (AD) // 1 BeforeCurrentEra (BC) - - [Serializable] - public class GregorianCalendar : Calendar { /* diff --git a/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs b/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs index bdc35f0734d4..1367e0d0acd9 100644 --- a/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs +++ b/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs @@ -10,7 +10,6 @@ namespace System.Globalization { // Gregorian Calendars use Era Info - [Serializable] internal class EraInfo { internal int era; // The value of the era. @@ -55,7 +54,6 @@ internal EraInfo(int era, int startYear, int startMonth, int startDay, int yearO // This calendar recognizes two era values: // 0 CurrentEra (AD) // 1 BeforeCurrentEra (BC) - [Serializable] internal class GregorianCalendarHelper { // 1 tick = 100ns = 10E-7 second diff --git a/src/mscorlib/src/System/Globalization/RegionInfo.cs b/src/mscorlib/src/System/Globalization/RegionInfo.cs index c3d5e659ca80..ab52002fdcdf 100644 --- a/src/mscorlib/src/System/Globalization/RegionInfo.cs +++ b/src/mscorlib/src/System/Globalization/RegionInfo.cs @@ -20,7 +20,6 @@ namespace System.Globalization { - [Serializable] public class RegionInfo { //--------------------------------------------------------------------// diff --git a/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs b/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs index 464897b03f9f..a875b7046334 100644 --- a/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs +++ b/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs @@ -20,7 +20,6 @@ namespace System.Globalization // This is public because GetTextElement() is public. // - [Serializable] public class TextElementEnumerator : IEnumerator { private String _str; diff --git a/src/mscorlib/src/System/Globalization/TextInfo.cs b/src/mscorlib/src/System/Globalization/TextInfo.cs index fecd2b297058..3b567b9f2052 100644 --- a/src/mscorlib/src/System/Globalization/TextInfo.cs +++ b/src/mscorlib/src/System/Globalization/TextInfo.cs @@ -19,7 +19,6 @@ namespace System.Globalization { - [Serializable] public partial class TextInfo : ICloneable, IDeserializationCallback { ////--------------------------------------------------------------------// diff --git a/src/mscorlib/src/System/IO/BinaryWriter.cs b/src/mscorlib/src/System/IO/BinaryWriter.cs index 3d9839f46e21..644226fa7938 100644 --- a/src/mscorlib/src/System/IO/BinaryWriter.cs +++ b/src/mscorlib/src/System/IO/BinaryWriter.cs @@ -27,7 +27,6 @@ namespace System.IO // primitives to an arbitrary stream. A subclass can override methods to // give unique encodings. // - [Serializable] public class BinaryWriter : IDisposable { public static readonly BinaryWriter Null = new BinaryWriter(); diff --git a/src/mscorlib/src/System/IO/DriveNotFoundException.cs b/src/mscorlib/src/System/IO/DriveNotFoundException.cs index 27b6f9015d42..2e37a13b5833 100644 --- a/src/mscorlib/src/System/IO/DriveNotFoundException.cs +++ b/src/mscorlib/src/System/IO/DriveNotFoundException.cs @@ -17,7 +17,6 @@ namespace System.IO { //Thrown when trying to access a drive that is not availabe. - [Serializable] internal class DriveNotFoundException : IOException { public DriveNotFoundException() diff --git a/src/mscorlib/src/System/IO/IOException.cs b/src/mscorlib/src/System/IO/IOException.cs index 2628f7b65250..1a49ec75a4f1 100644 --- a/src/mscorlib/src/System/IO/IOException.cs +++ b/src/mscorlib/src/System/IO/IOException.cs @@ -18,7 +18,6 @@ namespace System.IO { - [Serializable] public class IOException : SystemException { // For debugging purposes, store the complete path in the IOException diff --git a/src/mscorlib/src/System/IO/MemoryStream.cs b/src/mscorlib/src/System/IO/MemoryStream.cs index 3d5668d7743a..daf09d12740c 100644 --- a/src/mscorlib/src/System/IO/MemoryStream.cs +++ b/src/mscorlib/src/System/IO/MemoryStream.cs @@ -34,7 +34,6 @@ namespace System.IO // from an unsigned byte array, or you can create an empty one. Empty // memory streams are resizable, while ones created with a byte array provide // a stream "view" of the data. - [Serializable] public class MemoryStream : Stream { private byte[] _buffer; // Either allocated internally or externally. diff --git a/src/mscorlib/src/System/IO/Stream.cs b/src/mscorlib/src/System/IO/Stream.cs index 65cc4ddcb9ca..786dfedef9f7 100644 --- a/src/mscorlib/src/System/IO/Stream.cs +++ b/src/mscorlib/src/System/IO/Stream.cs @@ -30,7 +30,6 @@ namespace System.IO { - [Serializable] public abstract class Stream : MarshalByRefObject, IDisposable { public static readonly Stream Null = new NullStream(); @@ -854,7 +853,6 @@ internal static void BlockingEndWrite(IAsyncResult asyncResult) SynchronousAsyncResult.EndWrite(asyncResult); } - [Serializable] private sealed class NullStream : Stream { internal NullStream() { } @@ -1093,7 +1091,6 @@ internal static void EndWrite(IAsyncResult asyncResult) // SyncStream is a wrapper around a stream that takes // a lock for every operation making it thread safe. - [Serializable] internal sealed class SyncStream : Stream, IDisposable { private Stream _stream; diff --git a/src/mscorlib/src/System/IO/StreamReader.cs b/src/mscorlib/src/System/IO/StreamReader.cs index dfb928c85d0c..1fc72bffd1cc 100644 --- a/src/mscorlib/src/System/IO/StreamReader.cs +++ b/src/mscorlib/src/System/IO/StreamReader.cs @@ -16,7 +16,6 @@ namespace System.IO // This is designed for character input in a particular Encoding, // whereas the Stream class is designed for byte input and output. // - [Serializable] internal class StreamReader : TextReader { // StreamReader.Null is threadsafe. diff --git a/src/mscorlib/src/System/IO/TextReader.cs b/src/mscorlib/src/System/IO/TextReader.cs index 3da68591b0f2..2531778d6d95 100644 --- a/src/mscorlib/src/System/IO/TextReader.cs +++ b/src/mscorlib/src/System/IO/TextReader.cs @@ -30,7 +30,6 @@ namespace System.IO { // // This class is intended for character input, not bytes. // There are methods on the Stream class for reading bytes. - [Serializable] internal abstract class TextReader : MarshalByRefObject, IDisposable { public static readonly TextReader Null = new NullTextReader(); @@ -263,7 +262,6 @@ public static TextReader Synchronized(TextReader reader) return new SyncTextReader(reader); } - [Serializable] private sealed class NullTextReader : TextReader { public NullTextReader(){} @@ -280,7 +278,6 @@ public override String ReadLine() } } - [Serializable] internal sealed class SyncTextReader : TextReader { internal TextReader _in; diff --git a/src/mscorlib/src/System/InsufficientMemoryException.cs b/src/mscorlib/src/System/InsufficientMemoryException.cs index eb5e4d743048..6990b57dcb6c 100644 --- a/src/mscorlib/src/System/InsufficientMemoryException.cs +++ b/src/mscorlib/src/System/InsufficientMemoryException.cs @@ -22,7 +22,6 @@ namespace System { - [Serializable] public sealed class InsufficientMemoryException : OutOfMemoryException { public InsufficientMemoryException() diff --git a/src/mscorlib/src/System/MissingFieldException.cs b/src/mscorlib/src/System/MissingFieldException.cs index 39f66a2b37ab..0a91dd2b659f 100644 --- a/src/mscorlib/src/System/MissingFieldException.cs +++ b/src/mscorlib/src/System/MissingFieldException.cs @@ -17,7 +17,6 @@ namespace System { - [Serializable] public class MissingFieldException : MissingMemberException, ISerializable { public MissingFieldException() diff --git a/src/mscorlib/src/System/MissingMemberException.cs b/src/mscorlib/src/System/MissingMemberException.cs index 0b8342f3c6b3..92454c36b368 100644 --- a/src/mscorlib/src/System/MissingMemberException.cs +++ b/src/mscorlib/src/System/MissingMemberException.cs @@ -21,7 +21,6 @@ namespace System { - [Serializable] public class MissingMemberException : MemberAccessException, ISerializable { public MissingMemberException() diff --git a/src/mscorlib/src/System/MulticastDelegate.cs b/src/mscorlib/src/System/MulticastDelegate.cs index 440c9a60bc45..988bf2bb60d9 100644 --- a/src/mscorlib/src/System/MulticastDelegate.cs +++ b/src/mscorlib/src/System/MulticastDelegate.cs @@ -13,7 +13,6 @@ namespace System { - [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public abstract class MulticastDelegate : Delegate { @@ -50,49 +49,7 @@ internal bool InvocationListLogicallyNull() public override void GetObjectData(SerializationInfo info, StreamingContext context) { - int targetIndex = 0; - Object[] invocationList = _invocationList as Object[]; - if (invocationList == null) - { - MethodInfo method = Method; - // A MethodInfo object can be a RuntimeMethodInfo, a RefEmit method (MethodBuilder, etc), or a DynamicMethod - // One can only create delegates on RuntimeMethodInfo and DynamicMethod. - // If it is not a RuntimeMethodInfo (must be a DynamicMethod) or if it is an unmanaged function pointer, throw - if (!(method is RuntimeMethodInfo) || IsUnmanagedFunctionPtr()) - throw new SerializationException(SR.Serialization_InvalidDelegateType); - - // We can't deal with secure delegates either. - if (!InvocationListLogicallyNull() && !_invocationCount.IsNull() && !_methodPtrAux.IsNull()) - throw new SerializationException(SR.Serialization_InvalidDelegateType); - - DelegateSerializationHolder.GetDelegateSerializationInfo(info, this.GetType(), Target, method, targetIndex); - } - else - { - DelegateSerializationHolder.DelegateEntry nextDe = null; - int invocationCount = (int)_invocationCount; - for (int i = invocationCount; --i >= 0;) - { - MulticastDelegate d = (MulticastDelegate)invocationList[i]; - MethodInfo method = d.Method; - // If it is not a RuntimeMethodInfo (must be a DynamicMethod) or if it is an unmanaged function pointer, skip - if (!(method is RuntimeMethodInfo) || IsUnmanagedFunctionPtr()) - continue; - - // We can't deal with secure delegates either. - if (!d.InvocationListLogicallyNull() && !d._invocationCount.IsNull() && !d._methodPtrAux.IsNull()) - continue; - - DelegateSerializationHolder.DelegateEntry de = DelegateSerializationHolder.GetDelegateSerializationInfo(info, d.GetType(), d.Target, method, targetIndex++); - if (nextDe != null) - nextDe.Entry = de; - - nextDe = de; - } - // if nothing was serialized it is a delegate over a DynamicMethod, so just throw - if (nextDe == null) - throw new SerializationException(SR.Serialization_InvalidDelegateType); - } + throw new SerializationException(SR.Serialization_DelegatesNotSupported); } // equals returns true IIF the delegate is not null and has the diff --git a/src/mscorlib/src/System/Object.cs b/src/mscorlib/src/System/Object.cs index 3c304422ac47..a47655791135 100644 --- a/src/mscorlib/src/System/Object.cs +++ b/src/mscorlib/src/System/Object.cs @@ -201,7 +201,6 @@ private FieldInfo GetFieldInfo(String typeName, String fieldName) // The name "__Canon" will never been seen by users but it will appear a lot in debugger stack traces // involving generics so it is kept deliberately short as to avoid being a nuisance. - [Serializable] [ClassInterface(ClassInterfaceType.AutoDual)] [System.Runtime.InteropServices.ComVisible(true)] internal class __Canon diff --git a/src/mscorlib/src/System/OleAutBinder.cs b/src/mscorlib/src/System/OleAutBinder.cs index 1db61bb30ef1..3a9f03c5f079 100644 --- a/src/mscorlib/src/System/OleAutBinder.cs +++ b/src/mscorlib/src/System/OleAutBinder.cs @@ -15,7 +15,6 @@ namespace System using CultureInfo = System.Globalization.CultureInfo; // Made serializable in anticipation of this class eventually having state. - [Serializable] internal class OleAutBinder : DefaultBinder { // ChangeType diff --git a/src/mscorlib/src/System/OutOfMemoryException.cs b/src/mscorlib/src/System/OutOfMemoryException.cs index 154d0f92e283..7ffb029f5df7 100644 --- a/src/mscorlib/src/System/OutOfMemoryException.cs +++ b/src/mscorlib/src/System/OutOfMemoryException.cs @@ -17,7 +17,6 @@ namespace System { - [Serializable] public class OutOfMemoryException : SystemException { public OutOfMemoryException() diff --git a/src/mscorlib/src/System/Reflection/AssemblyName.cs b/src/mscorlib/src/System/Reflection/AssemblyName.cs index 996a20608307..6a077f647a8d 100644 --- a/src/mscorlib/src/System/Reflection/AssemblyName.cs +++ b/src/mscorlib/src/System/Reflection/AssemblyName.cs @@ -27,7 +27,6 @@ namespace System.Reflection using System.Diagnostics.Contracts; using System.Text; - [Serializable] public sealed class AssemblyName : ICloneable, ISerializable, IDeserializationCallback { // diff --git a/src/mscorlib/src/System/Reflection/CustomAttribute.cs b/src/mscorlib/src/System/Reflection/CustomAttribute.cs index 031b4f45092a..1cf00f17d87a 100644 --- a/src/mscorlib/src/System/Reflection/CustomAttribute.cs +++ b/src/mscorlib/src/System/Reflection/CustomAttribute.cs @@ -20,7 +20,6 @@ namespace System.Reflection { - [Serializable] public class CustomAttributeData { #region Public Static Members @@ -570,7 +569,6 @@ public virtual IList NamedArguments #endregion } - [Serializable] public struct CustomAttributeNamedArgument { #region Public Static Members @@ -659,7 +657,6 @@ internal Type ArgumentType } - [Serializable] public struct CustomAttributeTypedArgument { #region Public Static Members @@ -958,7 +955,6 @@ public object Value #endregion } - [Serializable] internal struct CustomAttributeRecord { internal ConstArray blob; @@ -989,7 +985,6 @@ internal enum CustomAttributeEncoding : int Enum = 0x55 } - [Serializable] [StructLayout(LayoutKind.Auto)] internal struct CustomAttributeEncodedArgument { @@ -1044,7 +1039,6 @@ internal static void ParseAttributeArguments(ConstArray attributeBlob, #endregion } - [Serializable] [StructLayout(LayoutKind.Auto)] internal struct CustomAttributeNamedParameter { @@ -1076,7 +1070,6 @@ public CustomAttributeNamedParameter(string argumentName, CustomAttributeEncodin #endregion } - [Serializable] [StructLayout(LayoutKind.Auto)] internal struct CustomAttributeCtorParameter { @@ -1098,7 +1091,6 @@ public CustomAttributeCtorParameter(CustomAttributeType type) #endregion } - [Serializable] [StructLayout(LayoutKind.Auto)] internal struct CustomAttributeType { diff --git a/src/mscorlib/src/System/Reflection/Emit/EventToken.cs b/src/mscorlib/src/System/Reflection/Emit/EventToken.cs index 18ec630b5f23..e44dc3d0ce72 100644 --- a/src/mscorlib/src/System/Reflection/Emit/EventToken.cs +++ b/src/mscorlib/src/System/Reflection/Emit/EventToken.cs @@ -18,7 +18,6 @@ namespace System.Reflection.Emit { - [Serializable] public struct EventToken { public static readonly EventToken Empty = new EventToken(); diff --git a/src/mscorlib/src/System/Reflection/Emit/FieldToken.cs b/src/mscorlib/src/System/Reflection/Emit/FieldToken.cs index 6c5d778d8f45..c7450ca301b7 100644 --- a/src/mscorlib/src/System/Reflection/Emit/FieldToken.cs +++ b/src/mscorlib/src/System/Reflection/Emit/FieldToken.cs @@ -22,7 +22,6 @@ namespace System.Reflection.Emit // by the Metadata to represent the field. FieldTokens are generated by // Module.GetFieldToken(). There are no meaningful accessors on this class, // but it can be passed to ILGenerator which understands it's internals. - [Serializable] public struct FieldToken { public static readonly FieldToken Empty = new FieldToken(); diff --git a/src/mscorlib/src/System/Reflection/Emit/Label.cs b/src/mscorlib/src/System/Reflection/Emit/Label.cs index f6315a67d23b..d67c0e6a19b5 100644 --- a/src/mscorlib/src/System/Reflection/Emit/Label.cs +++ b/src/mscorlib/src/System/Reflection/Emit/Label.cs @@ -26,7 +26,6 @@ namespace System.Reflection.Emit // is passed to the MethodWriter. // Labels are created by using ILGenerator.CreateLabel and their position is set // by using ILGenerator.MarkLabel. - [Serializable] public struct Label { internal int m_label; diff --git a/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs b/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs index 0905ac922a54..9698b0733398 100644 --- a/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs +++ b/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs @@ -18,7 +18,6 @@ namespace System.Reflection.Emit { - [Serializable] public struct MethodToken { public static readonly MethodToken Empty = new MethodToken(); diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs index 4f1b8eb713c4..4a9b774d1504 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs @@ -19,7 +19,6 @@ namespace System.Reflection.Emit // This is a package private class. This class hold all of the managed // data member for ModuleBuilder. Note that what ever data members added to // this class cannot be accessed from the EE. - [Serializable] internal class ModuleBuilderData { internal ModuleBuilderData(ModuleBuilder module, String strModuleName, String strFileName, int tkFile) diff --git a/src/mscorlib/src/System/Reflection/Emit/ParameterToken.cs b/src/mscorlib/src/System/Reflection/Emit/ParameterToken.cs index 42f85af46475..067bc2d01009 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ParameterToken.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ParameterToken.cs @@ -20,7 +20,6 @@ namespace System.Reflection.Emit { // The ParameterToken class is an opaque representation of the Token returned // by the Metadata to represent the parameter. - [Serializable] public struct ParameterToken { public static readonly ParameterToken Empty = new ParameterToken(); diff --git a/src/mscorlib/src/System/Reflection/Emit/PropertyToken.cs b/src/mscorlib/src/System/Reflection/Emit/PropertyToken.cs index b450b198d26d..02f34881f404 100644 --- a/src/mscorlib/src/System/Reflection/Emit/PropertyToken.cs +++ b/src/mscorlib/src/System/Reflection/Emit/PropertyToken.cs @@ -18,7 +18,6 @@ namespace System.Reflection.Emit { - [Serializable] public struct PropertyToken { public static readonly PropertyToken Empty = new PropertyToken(); diff --git a/src/mscorlib/src/System/Reflection/Emit/StringToken.cs b/src/mscorlib/src/System/Reflection/Emit/StringToken.cs index 1d90816fc649..cc5b734ae879 100644 --- a/src/mscorlib/src/System/Reflection/Emit/StringToken.cs +++ b/src/mscorlib/src/System/Reflection/Emit/StringToken.cs @@ -18,7 +18,6 @@ namespace System.Reflection.Emit { - [Serializable] public struct StringToken { internal int m_string; diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs b/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs index 4f0c1b3dac2c..15a0816a503c 100644 --- a/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs +++ b/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs @@ -19,7 +19,6 @@ namespace System.Reflection.Emit { - [Serializable] public struct TypeToken { public static readonly TypeToken Empty = new TypeToken(); diff --git a/src/mscorlib/src/System/Reflection/MdFieldInfo.cs b/src/mscorlib/src/System/Reflection/MdFieldInfo.cs index 41ee4d92978f..9645b7fef282 100644 --- a/src/mscorlib/src/System/Reflection/MdFieldInfo.cs +++ b/src/mscorlib/src/System/Reflection/MdFieldInfo.cs @@ -9,7 +9,6 @@ namespace System.Reflection { - [Serializable] internal sealed unsafe class MdFieldInfo : RuntimeFieldInfo, ISerializable { #region Private Data Members diff --git a/src/mscorlib/src/System/Reflection/MdImport.cs b/src/mscorlib/src/System/Reflection/MdImport.cs index 5744187eb2b2..9230ffa9ef2b 100644 --- a/src/mscorlib/src/System/Reflection/MdImport.cs +++ b/src/mscorlib/src/System/Reflection/MdImport.cs @@ -161,7 +161,6 @@ internal enum MetadataTokenType Invalid = 0x7FFFFFFF, } - [Serializable] internal struct ConstArray { public IntPtr Signature { get { return m_constArray; } } @@ -186,7 +185,6 @@ public byte this[int index] internal IntPtr m_constArray; } - [Serializable] internal struct MetadataToken { #region Implicit Cast Operators diff --git a/src/mscorlib/src/System/Reflection/RtFieldInfo.cs b/src/mscorlib/src/System/Reflection/RtFieldInfo.cs index 20d6e6392f07..ddfc56b2aa8b 100644 --- a/src/mscorlib/src/System/Reflection/RtFieldInfo.cs +++ b/src/mscorlib/src/System/Reflection/RtFieldInfo.cs @@ -11,7 +11,6 @@ namespace System.Reflection { - [Serializable] internal unsafe sealed class RtFieldInfo : RuntimeFieldInfo, IRuntimeFieldInfo { #region FCalls diff --git a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs index cb2d156521c2..6223a03c49b6 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs @@ -18,7 +18,6 @@ namespace System.Reflection { - [Serializable] internal class RuntimeAssembly : Assembly { #if FEATURE_APPX diff --git a/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs index 8c3b1fce98e1..433c2f37b566 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs @@ -11,7 +11,6 @@ namespace System.Reflection { - [Serializable] internal sealed class RuntimeConstructorInfo : ConstructorInfo, ISerializable, IRuntimeMethodInfo { #region Private Data Members diff --git a/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs index 930e1820bdf5..619f3e92db0d 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs @@ -10,7 +10,6 @@ namespace System.Reflection { - [Serializable] internal unsafe sealed class RuntimeEventInfo : EventInfo, ISerializable { #region Private Data Members diff --git a/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs index 29cc97d2252c..601287a06e7b 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs @@ -9,7 +9,6 @@ namespace System.Reflection { - [Serializable] internal abstract class RuntimeFieldInfo : FieldInfo, ISerializable { #region Private Data Members diff --git a/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs index b8a2341e4e85..22da0b8825ae 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs @@ -14,7 +14,6 @@ namespace System.Reflection { - [Serializable] internal sealed class RuntimeMethodInfo : MethodInfo, ISerializable, IRuntimeMethodInfo { #region Private Data Members diff --git a/src/mscorlib/src/System/Reflection/RuntimeModule.cs b/src/mscorlib/src/System/Reflection/RuntimeModule.cs index 75809cba0145..b5020a73625f 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeModule.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeModule.cs @@ -12,7 +12,6 @@ namespace System.Reflection { - [Serializable] internal class RuntimeModule : Module { internal RuntimeModule() { throw new NotSupportedException(); } diff --git a/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs index addf68e75dca..846ec1dd0469 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs @@ -11,7 +11,6 @@ namespace System.Reflection { - [Serializable] internal unsafe sealed class RuntimeParameterInfo : ParameterInfo, ISerializable { #region Static Members diff --git a/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs b/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs index b6a4792e4f8c..843a5443c31d 100644 --- a/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs @@ -12,7 +12,6 @@ namespace System.Reflection { - [Serializable] internal unsafe sealed class RuntimePropertyInfo : PropertyInfo, ISerializable { #region Private Data Members diff --git a/src/mscorlib/src/System/Resources/ResourceManager.cs b/src/mscorlib/src/System/Resources/ResourceManager.cs index 993efddbfc9a..e3981481f7d2 100644 --- a/src/mscorlib/src/System/Resources/ResourceManager.cs +++ b/src/mscorlib/src/System/Resources/ResourceManager.cs @@ -149,7 +149,6 @@ internal class PRIExceptionInfo // is one such example. // - [Serializable] public class ResourceManager { internal class CultureNameResourceSetPair diff --git a/src/mscorlib/src/System/Resources/ResourceSet.cs b/src/mscorlib/src/System/Resources/ResourceSet.cs index 9efff0d8c72f..b4029a7e9c1d 100644 --- a/src/mscorlib/src/System/Resources/ResourceSet.cs +++ b/src/mscorlib/src/System/Resources/ResourceSet.cs @@ -32,7 +32,6 @@ namespace System.Resources // enumerates over an IResourceReader, loading every name and value, and // stores them in a hash table. Custom IResourceReaders can be used. // - [Serializable] public class ResourceSet : IDisposable, IEnumerable { [NonSerialized] protected IResourceReader Reader; diff --git a/src/mscorlib/src/System/RtType.cs b/src/mscorlib/src/System/RtType.cs index b64f95bb6ae0..e37583a2cbf9 100644 --- a/src/mscorlib/src/System/RtType.cs +++ b/src/mscorlib/src/System/RtType.cs @@ -71,7 +71,6 @@ internal enum TypeNameKind FullName, } - [Serializable] internal class RuntimeType : System.Reflection.TypeInfo, ISerializable, ICloneable { @@ -4910,7 +4909,6 @@ internal static Type GetTypeFromCLSIDImpl(Guid clsid, String server, bool throwO // method (RuntimeType) and an instance of this type will work around the reason to have this type in the // first place. However given RuntimeType is not public all its methods are protected and require full trust // to be accessed - [Serializable] internal class ReflectionOnlyType : RuntimeType { private ReflectionOnlyType() { } diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/CustomConstantAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/CustomConstantAttribute.cs index 8f4c79cd945c..7393bb2bcd09 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/CustomConstantAttribute.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/CustomConstantAttribute.cs @@ -7,7 +7,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] public abstract class CustomConstantAttribute : Attribute { diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs index 7aca42b627e5..5155d0085d95 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs @@ -7,7 +7,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] public sealed class DateTimeConstantAttribute : CustomConstantAttribute { diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs index 0e2b6f841801..f5fd5a21a33f 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs @@ -12,7 +12,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] public sealed class DecimalConstantAttribute : Attribute { diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/MethodImplAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/MethodImplAttribute.cs index b24018cf78cc..3c19ee886332 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/MethodImplAttribute.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/MethodImplAttribute.cs @@ -12,7 +12,6 @@ namespace System.Runtime.CompilerServices // certain method properties. // Custom attribute to specify additional method properties. - [Serializable] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] sealed public class MethodImplAttribute : Attribute { diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs index 97365b0f221d..2554820f7cdb 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs @@ -17,7 +17,6 @@ namespace System.Runtime.CompilerServices { - [Serializable] public sealed class RuntimeWrappedException : Exception { private RuntimeWrappedException(Object thrownObject) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ArrayWithOffset.cs b/src/mscorlib/src/System/Runtime/InteropServices/ArrayWithOffset.cs index c4beb024b11a..e009db277fda 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/ArrayWithOffset.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/ArrayWithOffset.cs @@ -9,7 +9,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public struct ArrayWithOffset { //private ArrayWithOffset() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/BStrWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/BStrWrapper.cs index 77c38139cd62..586b03b366e7 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/BStrWrapper.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/BStrWrapper.cs @@ -17,7 +17,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public sealed class BStrWrapper { public BStrWrapper(String value) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs b/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs index 889a74f6bc29..a195616ab1e2 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs @@ -22,7 +22,6 @@ namespace System.Runtime.InteropServices { // Exception for COM Interop errors where we don't recognize the HResult. // - [Serializable] public class COMException : ExternalException { public COMException() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs b/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs index 2006bf849755..05a9e3f17636 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs @@ -33,7 +33,6 @@ public enum LIBFLAGS : short } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - [Serializable] public struct TYPELIBATTR { public Guid guid; diff --git a/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs index 4b436825e877..590925aafe64 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs @@ -16,7 +16,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public sealed class CurrencyWrapper { public CurrencyWrapper(Decimal obj) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/DispatchWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/DispatchWrapper.cs index 87ec4ed15e02..5fb78c56add0 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/DispatchWrapper.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/DispatchWrapper.cs @@ -17,7 +17,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public sealed class DispatchWrapper { public DispatchWrapper(Object obj) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs index 73be2c577782..34237d539a6f 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs @@ -16,7 +16,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public sealed class ErrorWrapper { public ErrorWrapper(int errorCode) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs b/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs index 2fae2b6e528c..30c2c66878f9 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs @@ -17,7 +17,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public class InvalidComObjectException : SystemException { public InvalidComObjectException() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs b/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs index 5154a028ad5e..0cbf01d90968 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs @@ -16,7 +16,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public class InvalidOleVariantTypeException : SystemException { public InvalidOleVariantTypeException() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs b/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs index 6fe7574e266f..16e260e1e262 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs @@ -17,7 +17,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public class MarshalDirectiveException : SystemException { public MarshalDirectiveException() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs b/src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs index 5595fadc4305..cbc4fc1d8d23 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs @@ -19,7 +19,6 @@ namespace System.Runtime.InteropServices { // Exception for Structured Exception Handler exceptions. // - [Serializable] public class SEHException : ExternalException { public SEHException() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs index f39f1f3a41d4..4f33595c1bbf 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs @@ -16,7 +16,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public class SafeArrayRankMismatchException : SystemException { public SafeArrayRankMismatchException() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs index 22832634223c..ccd31b5e6ad2 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs @@ -17,7 +17,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public class SafeArrayTypeMismatchException : SystemException { public SafeArrayTypeMismatchException() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/UnknownWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/UnknownWrapper.cs index c758ae1b4f99..de06cbf1a8ec 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/UnknownWrapper.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/UnknownWrapper.cs @@ -16,7 +16,6 @@ namespace System.Runtime.InteropServices { - [Serializable] public sealed class UnknownWrapper { public UnknownWrapper(Object obj) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/VariantWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/VariantWrapper.cs index 50689e08f8b0..455f0759fe1e 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/VariantWrapper.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/VariantWrapper.cs @@ -16,8 +16,6 @@ namespace System.Runtime.InteropServices { - [Serializable] - public sealed class VariantWrapper { public VariantWrapper(Object obj) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs index 4549a407e0d9..0ed0bb3f7bc9 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs @@ -21,7 +21,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime /// /// Type of objects that act as keys. /// Type of objects that act as entries / values. - [Serializable] [DebuggerDisplay("Count = {Count}")] internal sealed class ConstantSplittableMap : IMapView { @@ -169,7 +168,6 @@ public bool TryGetValue(TKey key, out TValue value) #region IKeyValuePair Enumerator - [Serializable] internal struct IKeyValuePairEnumerator : IEnumerator> { private KeyValuePair[] _array; diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs index 2a34aba71721..f2434ce91deb 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs @@ -9,7 +9,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime { - [Serializable] [DebuggerDisplay("Count = {Count}")] internal sealed class DictionaryKeyCollection : ICollection { @@ -83,7 +82,6 @@ public IEnumerator GetEnumerator() } // public class DictionaryKeyCollection - [Serializable] internal sealed class DictionaryKeyEnumerator : IEnumerator { private readonly IDictionary dictionary; diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs index 083b0ffcb1cc..6be0ddd9f01f 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs @@ -13,7 +13,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime { - [Serializable] [DebuggerDisplay("Count = {Count}")] internal sealed class DictionaryValueCollection : ICollection { @@ -91,7 +90,6 @@ public IEnumerator GetEnumerator() } // public class DictionaryValueCollection - [Serializable] internal sealed class DictionaryValueEnumerator : IEnumerator { private readonly IDictionary dictionary; diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs index e06364dcaefe..0900012338aa 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs @@ -123,7 +123,6 @@ private static V Lookup(IMapView _this, K key) } // Note: One day we may make these return IReadOnlyCollection - [Serializable] [DebuggerDisplay("Count = {Count}")] internal sealed class ReadOnlyDictionaryKeyCollection : IEnumerable { @@ -178,7 +177,6 @@ public IEnumerator GetEnumerator() } // public class ReadOnlyDictionaryKeyCollection - [Serializable] internal sealed class ReadOnlyDictionaryKeyEnumerator : IEnumerator { private readonly IReadOnlyDictionary dictionary; @@ -220,7 +218,6 @@ public void Reset() } // class ReadOnlyDictionaryKeyEnumerator - [Serializable] [DebuggerDisplay("Count = {Count}")] internal sealed class ReadOnlyDictionaryValueCollection : IEnumerable { @@ -279,7 +276,6 @@ public IEnumerator GetEnumerator() } // public class ReadOnlyDictionaryValueCollection - [Serializable] internal sealed class ReadOnlyDictionaryValueEnumerator : IEnumerator { private readonly IReadOnlyDictionary dictionary; diff --git a/src/mscorlib/src/System/RuntimeHandles.cs b/src/mscorlib/src/System/RuntimeHandles.cs index fd32547af773..dc40abc69a7b 100644 --- a/src/mscorlib/src/System/RuntimeHandles.cs +++ b/src/mscorlib/src/System/RuntimeHandles.cs @@ -23,7 +23,6 @@ namespace System using System.Diagnostics.Contracts; using StackCrawlMark = System.Threading.StackCrawlMark; - [Serializable] public unsafe struct RuntimeTypeHandle : ISerializable { // Returns handle for interop with EE. The handle is guaranteed to be non-null. @@ -784,7 +783,6 @@ RuntimeMethodHandleInternal Value } } - [Serializable] public unsafe struct RuntimeMethodHandle : ISerializable { // Returns handle for interop with EE. The handle is guaranteed to be non-null. @@ -1167,7 +1165,6 @@ RuntimeFieldHandleInternal IRuntimeFieldInfo.Value } } - [Serializable] public unsafe struct RuntimeFieldHandle : ISerializable { // Returns handle for interop with EE. The handle is guaranteed to be non-null. diff --git a/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs b/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs index ad88ef44009f..f70213f8d6cb 100644 --- a/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs +++ b/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs @@ -14,7 +14,6 @@ namespace System.Text { - [Serializable] internal sealed class InternalDecoderBestFitFallback : DecoderFallback { // Our variables diff --git a/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs b/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs index b98ef74ed273..953e87adc98b 100644 --- a/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs +++ b/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs @@ -8,7 +8,6 @@ namespace System.Text { - [Serializable] public sealed class DecoderExceptionFallback : DecoderFallback { // Construction @@ -99,7 +98,6 @@ private void Throw(byte[] bytesUnknown, int index) } // Exception for decoding unknown byte sequences. - [Serializable] public sealed class DecoderFallbackException : ArgumentException { private byte[] bytesUnknown = null; diff --git a/src/mscorlib/src/System/Text/DecoderFallback.cs b/src/mscorlib/src/System/Text/DecoderFallback.cs index 9311cda585f9..2a56706b988e 100644 --- a/src/mscorlib/src/System/Text/DecoderFallback.cs +++ b/src/mscorlib/src/System/Text/DecoderFallback.cs @@ -13,7 +13,6 @@ namespace System.Text { - [Serializable] public abstract class DecoderFallback { internal bool bIsMicrosoftBestFitFallback = false; diff --git a/src/mscorlib/src/System/Text/DecoderNLS.cs b/src/mscorlib/src/System/Text/DecoderNLS.cs index 6fcfc79140b2..03a6d7440f98 100644 --- a/src/mscorlib/src/System/Text/DecoderNLS.cs +++ b/src/mscorlib/src/System/Text/DecoderNLS.cs @@ -21,7 +21,6 @@ namespace System.Text // of Encoding objects. // - [Serializable] internal class DecoderNLS : Decoder, ISerializable { // Remember our encoding diff --git a/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs b/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs index b27469156dd3..0eaca3de4053 100644 --- a/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs +++ b/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs @@ -8,7 +8,6 @@ namespace System.Text { - [Serializable] public sealed class DecoderReplacementFallback : DecoderFallback { // Our variables diff --git a/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs b/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs index eb3165526bdd..b007f57efeaa 100644 --- a/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs +++ b/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs @@ -15,7 +15,6 @@ namespace System.Text { - [Serializable] internal sealed class InternalEncoderBestFitFallback : EncoderFallback { // Our variables diff --git a/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs b/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs index b75847d1e76c..fb5a423bb158 100644 --- a/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs +++ b/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs @@ -8,7 +8,6 @@ namespace System.Text { - [Serializable] public sealed class EncoderExceptionFallback : EncoderFallback { // Construction @@ -99,7 +98,6 @@ public override int Remaining } } - [Serializable] public sealed class EncoderFallbackException : ArgumentException { private char charUnknown; diff --git a/src/mscorlib/src/System/Text/EncoderFallback.cs b/src/mscorlib/src/System/Text/EncoderFallback.cs index 410b6f50167f..c3b9f47284d1 100644 --- a/src/mscorlib/src/System/Text/EncoderFallback.cs +++ b/src/mscorlib/src/System/Text/EncoderFallback.cs @@ -10,7 +10,6 @@ namespace System.Text { - [Serializable] public abstract class EncoderFallback { // disable csharp compiler warning #0414: field assigned unused value diff --git a/src/mscorlib/src/System/Text/EncoderNLS.cs b/src/mscorlib/src/System/Text/EncoderNLS.cs index 99a26ca57554..4e75959f40ed 100644 --- a/src/mscorlib/src/System/Text/EncoderNLS.cs +++ b/src/mscorlib/src/System/Text/EncoderNLS.cs @@ -21,7 +21,6 @@ namespace System.Text // of Encoding objects. // - [Serializable] internal class EncoderNLS : Encoder, ISerializable { // Need a place for the last left over character, most of our encodings use this diff --git a/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs b/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs index 65b807c1bdb3..a9ce9c10efd7 100644 --- a/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs +++ b/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs @@ -9,7 +9,6 @@ namespace System.Text { - [Serializable] public sealed class EncoderReplacementFallback : EncoderFallback { // Our variables diff --git a/src/mscorlib/src/System/Text/Encoding.cs b/src/mscorlib/src/System/Text/Encoding.cs index 5788051e238d..d6ab91d61305 100644 --- a/src/mscorlib/src/System/Text/Encoding.cs +++ b/src/mscorlib/src/System/Text/Encoding.cs @@ -81,7 +81,6 @@ namespace System.Text // generally executes faster. // - [Serializable] public abstract class Encoding : ICloneable { // For netcore we use UTF8 as default encoding since ANSI isn't available @@ -1408,7 +1407,6 @@ internal void ThrowCharsOverflow(DecoderNLS decoder, bool nothingDecoded) decoder.ClearMustFlush(); } - [Serializable] internal sealed class DefaultEncoder : Encoder, IObjectReference, ISerializable { private Encoding m_encoding; @@ -1530,7 +1528,6 @@ public unsafe override int GetBytes(char* chars, int charCount, } } - [Serializable] internal sealed class DefaultDecoder : Decoder, IObjectReference, ISerializable { private Encoding m_encoding; diff --git a/src/mscorlib/src/System/Text/Latin1Encoding.cs b/src/mscorlib/src/System/Text/Latin1Encoding.cs index e456b8533d80..b3e284d61974 100644 --- a/src/mscorlib/src/System/Text/Latin1Encoding.cs +++ b/src/mscorlib/src/System/Text/Latin1Encoding.cs @@ -18,7 +18,6 @@ namespace System.Text // Latin1Encoding is a simple override to optimize the GetString version of Latin1Encoding. // because of the best fit cases we can't do this when encoding the string, only when decoding // - [Serializable] internal class Latin1Encoding : EncodingNLS, ISerializable { // Used by Encoding.Latin1 for lazy initialization diff --git a/src/mscorlib/src/System/Text/UTF7Encoding.cs b/src/mscorlib/src/System/Text/UTF7Encoding.cs index 372af0da3755..5e524d2dda5f 100644 --- a/src/mscorlib/src/System/Text/UTF7Encoding.cs +++ b/src/mscorlib/src/System/Text/UTF7Encoding.cs @@ -13,7 +13,6 @@ namespace System.Text { - [Serializable] public class UTF7Encoding : Encoding { private const String base64Chars = @@ -832,7 +831,6 @@ public override int GetMaxCharCount(int byteCount) return charCount; } - [Serializable] // Of all the amazing things... This MUST be Decoder so that our com name // for System.Text.Decoder doesn't change private sealed class Decoder : DecoderNLS, ISerializable @@ -898,7 +896,6 @@ internal override bool HasState } } - [Serializable] // Of all the amazing things... This MUST be Encoder so that our com name // for System.Text.Encoder doesn't change private sealed class Encoder : EncoderNLS, ISerializable @@ -959,7 +956,6 @@ internal override bool HasState // Preexisting UTF7 behavior for bad bytes was just to spit out the byte as the next char // and turn off base64 mode if it was in that mode. We still exit the mode, but now we fallback. - [Serializable] private sealed class DecoderUTF7Fallback : DecoderFallback { // Construction. Default replacement fallback uses no best fit and ? replacement string diff --git a/src/mscorlib/src/System/Threading/ThreadInterruptedException.cs b/src/mscorlib/src/System/Threading/ThreadInterruptedException.cs index 9122df0d3e3a..cd7bd1cc537a 100644 --- a/src/mscorlib/src/System/Threading/ThreadInterruptedException.cs +++ b/src/mscorlib/src/System/Threading/ThreadInterruptedException.cs @@ -19,7 +19,6 @@ namespace System.Threading { - [Serializable] public class ThreadInterruptedException : SystemException { public ThreadInterruptedException() diff --git a/src/mscorlib/src/System/TypeLoadException.cs b/src/mscorlib/src/System/TypeLoadException.cs index 339ba08e7bed..a52e1bc46096 100644 --- a/src/mscorlib/src/System/TypeLoadException.cs +++ b/src/mscorlib/src/System/TypeLoadException.cs @@ -22,7 +22,6 @@ namespace System { - [Serializable] public class TypeLoadException : SystemException, ISerializable { public TypeLoadException() diff --git a/src/mscorlib/src/System/Variant.cs b/src/mscorlib/src/System/Variant.cs index cae5bdade4c4..b468ab2f980b 100644 --- a/src/mscorlib/src/System/Variant.cs +++ b/src/mscorlib/src/System/Variant.cs @@ -23,7 +23,6 @@ namespace System { - [Serializable] [StructLayout(LayoutKind.Sequential)] internal struct Variant { From 969a8c49a359afc521eba7992fec04a8db0d9992 Mon Sep 17 00:00:00 2001 From: Morgan Brown Date: Tue, 23 May 2017 14:33:05 -0700 Subject: [PATCH 2/2] Address PR comments --- src/mscorlib/shared/System/DefaultBinder.cs | 1 - .../System/Diagnostics/Tracing/EventSourceException.cs | 3 +++ src/mscorlib/src/System/Collections/Generic/Comparer.cs | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mscorlib/shared/System/DefaultBinder.cs b/src/mscorlib/shared/System/DefaultBinder.cs index 9e6a23222143..9adf702a02fb 100644 --- a/src/mscorlib/shared/System/DefaultBinder.cs +++ b/src/mscorlib/shared/System/DefaultBinder.cs @@ -8,7 +8,6 @@ namespace System { - //Marked serializable even though it has no state. #if CORECLR internal #else diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs index c766a9854754..73e32aaf53d3 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs @@ -18,6 +18,9 @@ namespace System.Diagnostics.Tracing /// /// Exception that is thrown when an error occurs during EventSource operation. /// +#if !CORECLR && !ES_BUILD_PN && !ES_BUILD_PCL && !CORERT + [Serializable] +#endif // !CORECLR && !ES_BUILD_PN && !ES_BUILD_PCL && !CORERT public class EventSourceException : Exception { /// diff --git a/src/mscorlib/src/System/Collections/Generic/Comparer.cs b/src/mscorlib/src/System/Collections/Generic/Comparer.cs index 644c4ee8bfa2..e163faa80f12 100644 --- a/src/mscorlib/src/System/Collections/Generic/Comparer.cs +++ b/src/mscorlib/src/System/Collections/Generic/Comparer.cs @@ -131,7 +131,7 @@ public override int Compare(T x, T y) // and have a SerializationInfo/StreamingContext ctor, // since we want to serialize as ObjectComparer for // back-compat reasons (see below). - + [Serializable] internal sealed class Int32EnumComparer : Comparer, ISerializable where T : struct { public Int32EnumComparer() @@ -166,6 +166,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) } } + [Serializable] internal sealed class UInt32EnumComparer : Comparer, ISerializable where T : struct { public UInt32EnumComparer() @@ -196,6 +197,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) } } + [Serializable] internal sealed class Int64EnumComparer : Comparer, ISerializable where T : struct { public Int64EnumComparer() @@ -223,6 +225,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) } } + [Serializable] internal sealed class UInt64EnumComparer : Comparer, ISerializable where T : struct { public UInt64EnumComparer()