Fix WeakReference in mscorlib ref assembly
authorStephen Toub <stoub@microsoft.com>
Fri, 19 Aug 2016 12:01:38 +0000 (08:01 -0400)
committerStephen Toub <stoub@microsoft.com>
Fri, 19 Aug 2016 12:02:54 +0000 (08:02 -0400)
It's missing the ISerializable implementation.

src/mscorlib/ref/mscorlib.cs

index abb6bddeeac57fd16e7ccbadb88e91cbfbc901d6..cc6a003a3d55041e7f5f8d81d6c2ab5c10d47eb5 100644 (file)
@@ -3933,7 +3933,7 @@ namespace System
     {
     }
     [System.Runtime.InteropServices.ComVisibleAttribute(true)]
-    public partial class WeakReference
+    public partial class WeakReference : System.Runtime.Serialization.ISerializable
     {
         [System.Security.SecuritySafeCriticalAttribute]
         protected WeakReference() { }
@@ -3942,14 +3942,16 @@ namespace System
         protected WeakReference(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
         public virtual bool IsAlive { [System.Security.SecuritySafeCriticalAttribute][System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]get { throw null; } }
         public virtual object Target { [System.Security.SecuritySafeCriticalAttribute][System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]get { throw null; } [System.Security.SecuritySafeCriticalAttribute][System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]set { } }
+        public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
         public virtual bool TrackResurrection { get { throw null; } }
         ~WeakReference() { }
     }
-    public sealed partial class WeakReference<T> where T : class
+    public sealed partial class WeakReference<T> : System.Runtime.Serialization.ISerializable where T : class
     {
         public WeakReference(T target) { }
         public WeakReference(T target, bool trackResurrection) { }
         ~WeakReference() { }
+        public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
         public void SetTarget(T target) { }
         [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public bool TryGetTarget(out T target) { target = default(T); throw null; }
     }