Post-Serialization cleanup fixes to Reflection (dotnet/coreclr#12010)
authorAtsushi Kanamori <AtsushiKan@users.noreply.github.com>
Wed, 31 May 2017 23:40:04 +0000 (16:40 -0700)
committerGitHub <noreply@github.com>
Wed, 31 May 2017 23:40:04 +0000 (16:40 -0700)
commitae013206cdbd6cad71c937c6d78d5727e270a415
tree63934f4b10a5e5f875f44866be7a3436c09f4aad
parent206a5c2eee7945544f22873c8a2537f2ddc35ce9
Post-Serialization cleanup fixes to Reflection (dotnet/coreclr#12010)

This is based on the following principles:

- We should not be making changes to instance/virtual methods
in the abstract base types for Reflection. These are apis
in themselves to third party classes that subclass these types.
Even if the Runtime chooses not to make its own implementations
of these type serializable, third party classes have the right
to make that choice for themselves and build off the base class
serialization infrastructure that was shipped before.

RuntimeAssembly and RuntimeModule still override with PNSE
so we'll get the desired exception for those cases.

- The Runtime's own implementations of these types will not be
serializable. Removing all [Serializable] attributes and
serialization interfaces. Runtime types are internal types and
thus have no duty to implement ISerializable if the public
abstract base type does not.

Commit migrated from https://github.com/dotnet/coreclr/commit/97c58ac4fce27b7796206a59eea0ca27cb49fe1a
src/coreclr/src/mscorlib/shared/System/Reflection/Assembly.cs
src/coreclr/src/mscorlib/shared/System/Reflection/Module.cs
src/coreclr/src/mscorlib/shared/System/Reflection/ParameterInfo.cs
src/coreclr/src/mscorlib/src/System/Reflection/MdFieldInfo.cs
src/coreclr/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs
src/coreclr/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs
src/coreclr/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs
src/coreclr/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs
src/coreclr/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs
src/coreclr/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs
src/coreclr/src/mscorlib/src/System/RtType.cs